- Joined
- Mar 1, 2013
- Messages
- 555
Hi everyone
I'm trying to decode mp3 files in C#. I've searched around for any resources to help me do so and found this: madlldlib.dll. Its my first time trying to import dll files. After a quick visit at msdn I figured that I basically declare a usable function in the dll file. I searched mydlldlib (download from first link) and found this:
So I tried to declare that function in C# as follows:
I get an error saying "unable to find an entry point named CbMpegAudioDecoder. What am I doing wrong?
I'm trying to decode mp3 files in C#. I've searched around for any resources to help me do so and found this: madlldlib.dll. Its my first time trying to import dll files. After a quick visit at msdn I figured that I basically declare a usable function in the dll file. I searched mydlldlib (download from first link) and found this:
Code:
/* callback decoder function (based on MpegAudioDecoder) */
extern "C" __declspec(dllexport) int __stdcall CbMpegAudioDecoder(
const char *InFN, /* input filename */
const char *OutFN, /* output filename */
int WavPad, /* 1=WAV file output, other = PCM */
char *StatMsg, /* status/error reporting */
/* Callback definition below
* The callback is used by this function to send
* reporting information back to the calling code
* while it is decoding.
*/
void (__stdcall *CbFunc)(unsigned long FrameCnt, unsigned long InByteTot, struct mad_header *Header)
);
#endif
So I tried to declare that function in C# as follows:
Code:
class MP3Decoder
{
[DllImport("C:\\Users\\1User\\Documents\\Visual Studio 2012\\Projects\\Sound Wave\\Sound Wave\\madlldlib.dll")]
private static extern long CbMpegAudioDecoder(string InFN, string OutFN, int WavPad, string StatMsg);
public void decode()
{
string input = "C:\\Users\\1User\\Music\\I Wanna Be.mp3";
string output = "C:\\Users\\1User\\Music\\out.txt";
string error = "";
CbMpegAudioDecoder(input, output, 1, error);
}
}
I get an error saying "unable to find an entry point named CbMpegAudioDecoder. What am I doing wrong?