Advertisement

Few DirectMusic questions

Started by February 04, 2005 12:11 AM
3 comments, last by Mulligan 19 years, 11 months ago
im looking through the documentation on DirectMusic and going in circles because I cant find the answers I need. Heres what I want to do: Create a class for my game which can load and play several sounds, and play a single audio track in the background at any given time. I got the first part done (loading lots of .wav sounds and playing them), but I dont know how to go about playing the music. The music I want to play would be in mp3 format. Should I just load the sound file the way I load the .wav files, or is there something different I need to do? Thanks.
MP3 cannot be played directly from DirectMusic. The easiest way to do it would be to use DirectShow. The more common way is to use DirectSound and the Windows Media SDK. DirectMusic can only play WAV and MIDI as far as I remember.
Anthony Rufrano
RealityFactory 2 Programmer
Advertisement
Thanks,

How do other people do it then? I've used both DirectSound and DirectShow, but have been told that DirectShow is too slow for games.

Is that true?


I'd like to add one more question...

If I have one sound segment, and have tell DirectMusic to play it several times simutaneously, how can I have a specific instance stop playing?

for instance, If i had a screaming monster sound playing because there are two monsters on the screen, then kill one monster, only one should be left screaming. Right now, when I tell the segment to stop, all the instances of the sound stop

thanks
Yes...DirectShow is a bit slow.

Most people use DirectSound and the Windows Media SDK. I highly recommend OGG Vorbis. It has a better compression ratio than MP3 and, IMHO, has better sound. The API is very friendly to use also.

Ahhh....you've reached a bug in DirectMusic. Switch over to DirectSound and that issue will be resolved. There is no way that I know of to work around that issue.

Have a look at the book Game Audio Programming by James Boer. It's a very good book. Helped me out a lot.
Anthony Rufrano
RealityFactory 2 Programmer
well then thanks, ill look into direct sound.

This topic is closed to new replies.

Advertisement