Hi!
I am new to Audioprogramming, so forgive me if this has been explained
already elsewhere. I didn`t find it in the forum.
I want to program an on the fly mp3 encoder under Linux. I record from a
microphone (/dev/dsp) a buffer of 300000 bytes. This happens in a thread.
Another thread then takes this buffer and encodes it with lame:
mp3encodesize =
lame_encode_buffer_interleaved(gfp,buffer,75000,mp4buff,mp3buffsize)
then I finish this with
mp3size = lame_encode_flush_nogap(gfp,mp3buff,mp3buffsize)
I write both of the mp3buffers into a file after another, and start again
with the next 300000 byte, every minute a new file is created.
This is working so far, but if I play it with madplay then I get the error messages: error :frame xyz : lost synchronization and I hear clicks in the file.
I am using lame 3.96. 1 .
What am I doing wrong? Or how should I do it?
Kind regards,
Hans