Encode Playback device capture audio data and write an mp3 file

I'm working on a project in which I'll have to encode my audio data.
I can capture the audio and create a .wav file but I want to compress it and make it an mp3 or .aac file.
I'm using ffmpeg for encoding.
If someone has done this.. Please help me.
If necessary I'll post my code and efforts.

Thanks!
read about this lib: http://www.mega-nerd.com/libsndfile/ it might be of use to you
Thanks for your reply!

Actually I've tried this project and it focuses on Transcoding of file format.
I'm having uncompressed raw data and I want to compress it and then create a file.

I've used Lame that uses same but I didn't get the way to use lame for buffer or raw data.

Thanks!
Topic archived. No new replies allowed.