libwmp3 library not working?

I'm using visual studio 2008 and I'm trying to make a C++ program that plays MP3 using the libwmp3 library. I tried doing a simple example they provided but I keep getting a link error.

Error 1 fatal error LNK1136: invalid or corrupt file C:\libwmp3-2.51-win\libwmp3.lib 1 mp3 test

Here is the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "libwmp3.h"

int main()
{
	/* create class instance */
	CWMp3* mp3 = CreateCWMp3();

	/* open file from disk */
	mp3->OpenFile("mysong.mp3",800, 0, 0);

	mp3->Play();

	/* ... wait here in some loop */

	MP3_STATUS status;
	mp3->GetStatus(&status);
	while(status.fPlay)
	{
		Sleep(200);
		mp3->GetStatus(&status);
	}



	/* destroy class instance */
	mp3->Release();
	return 0;
}


I downloaded the library from here:
http://www.inet.hr/~zcindori/libwmp3/index.html
As far as I know, I only need 3 files to load and use the DLL they provided, which is the LIB file, the Header file and the DLL file.
I was wondering is the LIB file not compatable with visual studio 2008 or is it really corrupted? I've downloaded it twice but I still get the same error.
Any help would be great, thanks!
Last edited on
There's something wrong with the LIB file, but I don't know what. When I used LibWMP3, I just shoved the source right into my own project. No complications. Increased the EXE size by 200KB though... >.>

If you don't mind increasing EXE size, I suggest you just do that.
You don't need any library to play MP3 ! (on Windows, no external libraries are needed, everything is included in Win32 api)
There are a dozen of native methods to read MP3 , WMA, etc ... (DS, MM apis, COM, ...)
Maybe in DirectSound, but the WinAPI only provides functions for WAV. Mind posting these magical functions?
> Maybe in DirectSound but the WinAPI only provides functions for WAV

No, even mci handles mp3...
(and DS *is* Win32 api)
Last edited on
(and DS *is* Win32 api)


No it's not. It's the DirectX API. It has its own SDK (which you need to download separately) and everything.

And can you post some example code of how to play an MP3 without another lib? I'm curious of this, myself.
Last edited on
> No it's not. It's the DirectX API

Are you joking ?!
DirectX api *is* Win32 api

MSDN =>
Win32 and COM Development >
Graphics and Multimedia >
DirectX >
DirectX Audio >
Reference >
DirectSound

> And can you post some example code of how to play an MP3 without another lib?

As I said mci, among others (for more than 15 years...)
Last edited on
george135 is right, mciSendString function works and the DirectX API is considered part of the Win32 API
Topic archived. No new replies allowed.