alaphate Posted July 5, 2012 Posted July 5, 2012 (edited) Which static lib could play mp3 from resource WITHOUT extracting the mp3 file to hard disk?C++ is prefered. Thank you buddies. Edited July 5, 2012 by alaphate
ghandi Posted July 5, 2012 Posted July 5, 2012 http://www.fmod.org/index.phpAt the very least, do a Google search first. This library should fulfil your needs, but i'm offering no guarantees.HR,Ghandi
alaphate Posted July 6, 2012 Author Posted July 6, 2012 Thank you.Fmod is very powerful, however, it uses fmod.dll.Where could I get a static lib without dll dependencies?Thanks.
ghandi Posted July 6, 2012 Posted July 6, 2012 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.htmlPlaying a MP3 in c++ using plain Windows APIWhile 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.zipHR,Ghandi
alaphate Posted July 6, 2012 Author Posted July 6, 2012 ghandi,Awesome!I appreciate your help very much.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now