Skip to main content
gamedev.net
🔒 Locked

DirectAudio Question

Started by Yarharhar Jan 7, 2001 at 9:02 PM 1 replies 500+ views
Original Post
Yarharhar
Yarharhar
It''s me again. I''ve just moved my sound code to direct Audio, but I''m a bit confused. Whenever I play a sound or midi, it stops any other sounds playing. They''re on different segments, so I know that''s not the problem. My question is, do I need to use more than one audiopath to play more than 1 wave/midi at the same time, and how many would I need? As many as the amount of sounds I have?
Jim Adams
Jim Adams
With DirectAudio, you have a main audio path, the default if you want, that plays only music. This is the primary control track that controls timing. Play wave sounds only on secondary audio paths, specifing the DMUS_SECONDARY flag on playback.

The only problem with DirectAudio is that the latency is horrible for playing sound effects. I wrote an entire library around DirectMusic just to find out it can take up to a whole second or two to start playing a sound effect, as the starting time is based off the beat of the primary audio path.

I would suggest using DMusic for MIDI and WAV song files, and keep DirectSound for sound effects.


Jim Adams

Yarharhar
Yarharhar
Thanks,playing the sounds as secondary segments worked!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.