Convert Wav to mp3?

Jens via Lame-dev <[email protected]> Wed, 20 Nov 2019 19:56:28 +0100
Newsgroups gmane.comp.audio.mp3.lame
Message-ID <[email protected]>

Hello,

I am creating a C programm which converts wav to mp3 files using the
libmp3lame.a library. I wonder me about the length of the converted
files: Wav has for example 22 secs, Bitrate 1152KBs and the converted
mp3 44 secs, Bitrate 97kbs. And the sound quality is really bad. Wav
file has 3MB, MP3 file 8KB.

What should I improve with following parameters to get a good sound quality?

     const int PCM_SIZE = 18424;
     const int MP3_SIZE = 13424;
     short int pcm_buffer[PCM_SIZE];
     unsigned char mp3_buffer[MP3_SIZE];
     lame_set_num_channels(lame, 1);
     lame_set_in_samplerate(lame, 22050);
     lame_set_out_samplerate(lame, 22050);
     lame_set_brate(lame, 240);
     lame_set_quality(lame, 2);

With best regards,
Jens


_______________________________________________
Lame-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lame-dev