Playing a midi using openAL?

Started by
2 comments, last by wazoo69 18 years, 10 months ago
Hello all, Is it possible to play a midi using openAL? And if so, how? I have only ever used openAL to play WAVE's. Does it support any other format "out of the box"? Thanks all.
Advertisement
Im afraid my friend, that OpenAL doesnt support other formats than WAVE, and given the fact the structure of a MIDI is very different, I really doubt it will someday

In the meantime, have you heard of TiMidity++?

cheers
The previous poster is correct, but to elaborate: most music (mp3,ogg,wma,flac) is encoded (and compressed, lossless or lossy) via a particular audio codec, then the codec is used to decode the music into waveform data. A wav file is essentially this raw form (hence the large size). MIDI operates in a somewhat different manner, so converting to waveform data is not as easy, and is not the natural step to play a midi. Sound cards have MIDI devices which are used to synthesize the information stored within the midi, it is possible but usually not the best solution to convert from this midi data into the waveform data which is found in most music formats.
For my current project I'm using SDL_Mixer and OpenAL for that very reason.

SDL_Mixer handles the midi stuff and I let OpenAL do the 3D sound stuff..

hth,
Learn about game programming!Games Programming in C++: Start to Finish

This topic is closed to new replies.

Advertisement