Dark Bit Factory & Gravity
PROGRAMMING => C / C++ /C# => Topic started by: fog76 on April 13, 2012
-
Hi all,
i wanted to know if it was possible to convert a .mod file into a .h file to have a small music stored directly into the executable file.
I mean something like this:
//into .h file
static Mix_Music *MyMusic = {0XFF, 0XBA, 0XCC.... and so on
to be simply called into main.cc in a similar manner:
Mix_PlayMusic(MyMusic, -1);
My idea is to create an executable file that contains within it the piece of music that should sound. In your opinion what is possible using SDL_mixer? And how can convert a .mod file into a .h file?
Thanks to all!
-
fog76, that is indeed possible. You need a program to convert the binary file into a header (.h) file. There are many variations of this program called "bin2inc". Here's one I just found. (http://www.harmlesslion.com/cgi-bin/onesoft.cgi?113)
-
Thanks Raizor, i will do some tests! K++!
-
HxD (http://mh-nexus.de/en/hxd/) is what I use for this sorta thing; just open the .mod and use export->C . Will do exactly what you want :) .
-
HxD (http://mh-nexus.de/en/hxd/) is what I use for this sorta thing; just open the .mod and use export->C . Will do exactly what you want :) .
That looks like a handy tool Ferris. Disk and RAM editing sounds especially cool :)
-
Yep this prog looks like really more usefull than the simple php script I made for this sort of conversion :D By the way Bin2inc will be fine also ;D