Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: playing mp3 files directly from the .exe

  1. #11

    playing mp3 files directly from the .exe

    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.

  2. #12

    playing mp3 files directly from the .exe

    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!!!

  3. #13

    playing mp3 files directly from the .exe

    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!
    Code:
    mmSystem.PlaySound(PCHAR(ResourceID), hInstance, SND_RESOURCE);
    Just don't forget to add a RIFF header to the mp3 before adding it to the application.

    Sure it's hacky and inflexible like hell, but gets the job done really fast..

    Hope this helps

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •