On a related issue, I am also converting some m4a files to mp3 for a playback unit that doesn't support m4a.
To do this, I used BASS_Init (0, 44100, 0, NULL, NULL) to set the output frequency to 44.1KHz (same as CD quality, and what I use in my CD ripping software.
I then load the AAC decoder plugin ("libbass_aac.so" in my case), so that I can use BASS_StreamCreateFile (0, filename, 0, 0, BASS_STREAM_DECODE) to open the source.
I call BASS_Encode_MP3_StartFile with the resulting handle, plus my options.
Then, I repeatedly call BASS_Channel_GetData until I reach the end of the stream, then call BASS_Encode_Stop.
This produces a valid MP3 file, but the frequency is 48KHz, not 44.1KHz.
I presume this is because the source is at 48KHz. Is there any way to set the output frequency as I want it, or would I have to use some external process (ffmpeg?) to do this?
[A short time later...]
Ignore that, I am being stupid. If I had taken the time to read the LAME documentation as well, I would have known that "--resample 44.1" will do what I want, while "--resample 44100" is quietly ignored
Apologies, now working as I wanted, and files converted.