问题
I wonder if someone can help me.
I'm trying to add a reference to the LAME MP3 encoder in my VB.Net (3.5) App.
The DLL I'm using (lame_enc.dll v3.98.2) was downloaded from here: http://rarewares.org/mp3-lame-bundle.php
When I try to add the DLL reference to my project, I get an error: "A reference to C:\\Lame_Enc.dll could not be added. Please make sure this file is accessible and that it is a valid assembly or COM component"
I would just assume this was a corrupt download/similar but...
- The archive passed an integrity test in WinRAR
- I tried re-downloading it JIC
Next thought - the DLL is b0rked but...
- I've googled and seen that this is a common issue in vs2005.
- There are quite a few discussions and none of them seem to have a useful conclusion
- I've tried the SDK tools "genasm"(3.5) and "TlbExp"(2.0) and both say it's not a valid DLL (As suggested in various threads).
So... I've come to the conclusion it's not a COM DLL or (obviously) a .Net one. It is probably intact but I can't reference it directly with VS.
Previously when I've added non-.Net DLLs, VS has created an INTEROP Class for me. I'd ideally like to achieve similar with this DLL.
Unfortunately, this is about the extent of my ability - Can someone please point me in the right direction for how to use this DLL (or another mechanism to interact with LAME)?
Many thanks in advance for any help
回答1:
This project (in C# albiet but the same principle must apply for VB.NET) refers to using the Lame_enc.dll. You could try downloading the sample project and see what they are doing compared with you :
http://www.codeproject.com/KB/audio-video/MP3Compressor.aspx
回答2:
This article uses a different approach at building a wrapper in VB.NET around lame.exe.
Have a look :
http://www.codeproject.com/KB/audio-video/LameShell.aspx?print=true
回答3:
Sounds like it's not a .Net DLL. You'll likely need to obtain a wrapper (Jayden's answer seems to be a wrapper).
As an aside, you're probably going to want to get LAME direct from the source.
来源:https://stackoverflow.com/questions/1377019/unable-to-add-a-dll-reference-to-vs-2008