This project has moved. For the latest updates, please go here.

lame_enc error

Jan 13, 2016 at 1:14 PM
Hey there.

I've been trying to encode audio as an mp3, but haven't got very far...
// Get path where LAME DLL is stored, something like
var dllPath = Path.Combine(".\lib", Environment.Is64BitProcess ? "x64" : "x86", "lame_enc.dll");
fine
// Set the location to the encoder
Mp3AudioEncoderLame.SetLameDllLocation(dllPath);
No problems
var mp3Stream = writer.AddMp3AudioStream(2, 44100, 192);
Error, and visual studio shows...
EntryPointNotFoundException was not handled
...
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in w12q2ys3
...
Additional information: Unable to find an entry point named 'lame_set_brate' in DLL 'lame_enc.dll'.
Can't for the life of me get anything different to happen :( Some hunting around seemed to indicate it would be a pinvoke type problem, lame_enc.dll being an external library? Any ideas? I thought sharpavi handled this aspect of things :(

Thanks :)
Coordinator
Jan 13, 2016 at 7:04 PM
Hi
I suppose this may be LAME version mismatch. Different version with different API.
What version of binaries did you use, possibly some older one?
SharpAvi's sample app uses binaries of v3.99.2.5.
Jan 14, 2016 at 12:28 PM
Using 3.99.5 (http://www.rarewares.org/mp3-lame-libraries.php)

Will try another couple of versions, see if they work!

M. :)
Coordinator
Jan 14, 2016 at 12:50 PM
It's strange. Those are exactly the same binaries that are used in the sample application.
Are you sure you pass a valid path to DLL of proper bitness to Mp3AudioEncoderLame.SetLameDllLocation? To my understanding, it should have crashed on call to this method in that case, but still...
Jan 14, 2016 at 1:00 PM
Yup - and I know that works due to the times I set the path wrong and it couldn't find the dll, went past fine after I fixed that.

I found a similar problem someone had with lame_enc in audacity...

http://forum.audacityteam.org/viewtopic.php?f=46&t=81448

Don't know if it's just a case of variants of the .dll!

Thanks :)

M.
Coordinator
Jan 14, 2016 at 1:16 PM
I've checked the second binary on that page (lame_enc.dll (3.99.5) modified to use INI File Setup) - and it indeed does not have required entry points. Do you use this one?
If so, try using binaries from the first entry libmp3lame 3.99.5.