Qbasicnews.com

Full Version: mmsystem help with midi file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

Im doing a simple math program that also plays a midi file using the "mmsystem" example, the things work fine like this

Code:
winmmPlayMidi( "soundtrak.mid" )
where soundtrak.mid is a file in the same folder than the exe

but since it is a small program i want to make it as an alone exe, whit the midi file inside.
I used to do it in C/C++ by opening an hex editor and putting the file in hex format inside the code as "0xf4, 0x3d,. ." hex data. I wonder if there is similar way to do this in freebasic, using an hexadecimal data type or similar, since i havent still find the way to do it.

Cheers and thanks
Yeah, you can do like in C using var-initializers, see this message from some days ago:
Code:
http://forum.qbasicnews.com/viewtopic.php?t=9526
, bin2bas will do it.

But i'm not sure how winmm will take a buffer as argument, i thought it only accepted file names, msdn may help.
thanks a lot v3cz0r,
I readed it, i never had the idea of append to the exe the data as a binary, and use the exe itself as data, I have already done it, write the mido to the same folder and open it, deleting it after. Smile