Hey,
I’m new to the SDL (I’m a convert from Allegro), and I was wondering how
I might get around to playing a MIDI file. If someone could give me a
short example code, or link me to some, that would be greatly
appreciated.
Thanks,
Cameron Matheson
You have to use SDL_Mixer for that, but sorry I haven’t got some exemples
right now …
“Cameron Matheson” a ?crit dans le message news:
39AC3771.80D4D072 at uswest.net…> Hey,
I’m new to the SDL (I’m a convert from Allegro), and I was wondering how
I might get around to playing a MIDI file. If someone could give me a
short example code, or link me to some, that would be greatly
appreciated.
Thanks,
Cameron Matheson
In article <39AC3771.80D4D072 at uswest.net>, you say…
I’m new to the SDL (I’m a convert from Allegro), and I was wondering how
I might get around to playing a MIDI file. If someone could give me a
short example code, or link me to some, that would be greatly
appreciated.
Link with SDL_Mixer then download the Timidity sound patches and
after unzipping them put them into the root directory of your
applications drive. eg: c:\Timidity
in your code write:
Mix_Music *music = Mix_LoadMUS("sndTrack.mid");
assert(music); // simple check for NULL.
Mix_PlayMusic(music, -1); // NB: -1 loops music
best wishes Cameron.
-dv
“Daniel” <daniel_v at bigpond.com> wrote in message
news:MPG.1417b3342af750ae11e1a300 at mail.bigpond.com…
Mix_Music *music = Mix_LoadMUS(“sndTrack.mid”);
assert(music); // simple check for NULL.
Mix_PlayMusic(music, -1); // NB: -1 loops music
Don’t use assert for checks that depend on external resources outside of the
immediate control of the program.–
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor