Help - Search - Members - Calendar
Full Version: Downmixing from a stereo wav file to a mono mp3 using lame.dll
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
mikeyg
Hi Guys,

I have a sample stereo wav file recorded at 44,100Hz, and I have been able to encode a mono mp3 file fine using the v3.97 lame command line and the -m m switch.

What I am trying to do though is to use the lame.dll and the C# wrapper classes found here to do the same, but I can't seem to find a way of changing the settings so that it reads the wav as a stereo file and encodes to a mono version. I tried changing the mpeg_mode setting to mono, but this reads the wav file as if it is also mono, thus doubling the length of the encoded mp3 file.

I assume there must be a way to downmix through the dll but I am struggling to find it? Has anyone managed this or can offer me some assistance?

Regards
Mike
pdq
There is a version of the dll that takes its settings from an ini file. I don't remember the specifics but I think it is available at rarewares.org.
Synthetic Soul
Unless I am mistaken, I think this is a common misconception with the modified DLL.

It will only allow the selection of the VBR presets, plus variable scale and the Y switch. It does not allow the user to set bespoke settings.

It looks to me that Aumplib has inbuilt functionality to downmix to mono. It may be that you will have to use the class to downmix stereo wave to mono wave, and then encode with LAME - not ideal I know.

An alternative is to build a bespoke LAME DLL with mono enforced.


Synthetic Soul
Edit: Suggestion removed. Sorry, just re-read your first post. Looks like you have already tried my suggestion.

I am confused as it appears that EAC can use the DLL to force mono encoding.
mikeyg
Thanks Synthetic Soul,

I have tried something like that by just adding the line

CODE
mpgmode = mpeg_mode.MONO;


straight after the switch block, but then when I run the encode it treated the wav as if it was a mono file.

This doubled the size of the mp3 file and made it sound very slow, ie, took the left and the right samples and played them as a single channel.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.