you can't play anything from memory with windows API except wav's, so no MediaPlayer won't help here. fmod is quite simple, try it.
you can't play anything from memory with windows API except wav's, so no MediaPlayer won't help here. fmod is quite simple, try it.
Hi Paulius..
hmmm = i will try fmod but a thought struck me = a bit long winded but would it work?? =
if one created a virtual drive ,then copied the mp3 to that, as an mp3 file using the above method .... then played it from that file with mediaplayer.... On termination of program destroy the virtual drive...
However
FROM THE ARTICLE
by Zarko Gajic
"You can store more that just code in the application executable file. An exe file can contain a WAV, AVI or even an MP3 file. The "trick" is in working with resources."
HOWEVER "One minor problem is that the application creates a mp3 song on a user machine. You could add a code that deletes that file before the application is terminated. "
THIS seems to be the easiest option... So I will probably settle for that ...
cheeeeeerrrrrrrsssss a
The Universe is all right here!!!
Umm... I might be reviving an old thread but... but it was on the first page!
Anyway, looks like most people forget that *.wav format file can hold more than only uncompressed data. And this combined with the fact, that acm mp3 codec is with us since Win95 times, allows us to create an mp3 resource player with a line of code!Just don't forget to add a RIFF header to the mp3 before adding it to the application.Code:mmSystem.PlaySound(PCHAR(ResourceID), hInstance, SND_RESOURCE);
Sure it's hacky and inflexible like hell, but gets the job done really fast..
Hope this helps
Bookmarks