views:

1158

answers:

3

Hi, 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  A: 

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

Jayden
Many thanks, I'll give it a go
Basiclife
Works well, many thanks :)
Basiclife
Did you figure out what, if anything you were doing wrong?
Jayden
Yeah, there's a lot of code doing:[DllImport("Lame_enc.dll")]and calling it the same way I would a win32 API. I decided to cheat and write a [very limited] wrapper in c# using the sample code as a starting point and then just reference my DLL from VBI believe I could've done this directly from VB - It's somewhere on my to do list...
Basiclife
(If you're interested, the code you need to look at is in Lame.cs in the yeti.mp3 project of the solution linked above)Thanks again for the help
Basiclife
+2  A: 

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

Jayden
Thanks, will do
Basiclife
+2  A: 

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.

Charlie Salts
Understood - The problem is I've seen that ppl have had problems compiling it in C++/Win/VS2008 - Hence going to get a pre-compiled version. I'd appreciate any advice though.
Basiclife