Jump to content
Tuts 4 You

Any static lib for playing mp3 from resource?


alaphate

Recommended Posts

Which static lib could play mp3 from resource WITHOUT extracting the mp3 file to hard disk?

C++ is prefered. Thank you buddies.

Edited by alaphate
Link to comment

Thank you.

Fmod is very powerful, however, it uses fmod.dll.

Where could I get a static lib without dll dependencies?

Thanks.

Link to comment

This is not a static lib, it is a header file and i don't know if it fulfils your needs once again:

http://code4k.blogspot.com.au/2010/05/playing-mp3-in-c-using-plain-windows.html

Playing a MP3 in c++ using plain Windows API

While playing a mp3 is quite common in a demo, I have seen that most demo are often using 3rd party dlls like Bass or FMod to perform this simple task under windows. But if we want to get rid off this dependency, how can we achieve this with a plain windows API? What's the requirements to have a practical MP3Player for a demo?

Surprisingly, I was not able to find a simple code sample other the Internet that explain how to play a mp3 with Windows API, without using the too simple Windows Media Player API. Why WMP is not enough (not even talking about MCI - Media Control Interface which is even more basic than WMP)?

The usage is then pretty simple :

MP3Player player;

// Open the mp3 from a file...

player.OpenFromFile("your.mp3");

// or From a memory location!

player.OpenFromMemory(ptrToMP3Song, bytesLength);

player.Play();

while (...) {

// Do here your synchro in the demo using

...

double playerPositionInSeconds = player.GetPosition()

...

}

player.Close();

http://xoofx.com/upload/TestMP3Player.zip

HR,

Ghandi

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...