Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Direct Audio: Playing more than one sound file at once

This topic is 6249 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Just started learning direct audio, and i can''t seem to work out how to play more than one sound at once. Can anyone help? Thanks all rath

Share this post

Link to post
Share on other sites
If you are using PlaySegmentEx to play your sound segments you can pass the DMUS_SEGF_NOINVALIDATE flag that will prevent it from killing any current segments.

soundsegments[index], // Segment to play.
NULL, // Used for songs; not implemented.
NULL, // For transitions.
DMUS_SEGF_NOINVALIDATE, // Do not kill any current segments
0, // Start time; 0 is immediate.
NULL, // Pointer that receives segment state.
NULL, // Object to stop.
NULL // Audiopath, if not default.

hope this helps


Share this post

Link to post
Share on other sites
Thanks for the reply.

I tried it but it didn''t help, the sound cut out when the second one started.

Should I be using two seperate audio paths? Or just the default one?



Share this post

Link to post
Share on other sites
Ooops forgot something. The sound segment that you do not want to stop should also have the DMUS_SEGF_SECONDARY flag set. I had some special things going on there I forgot about.

I think if you use this for all of your sounds you will be ok:

performance->PlaySegmentEx( segments[index], NULL, NULL, DMUS_SEGF_NOINVALIDATE | DMUS_SEGF_SECONDARY, 0, NULL, NULL, NULL );

They should play on the same audio path fine.

I posted my sound encapsulation class source in this message but the HTML parser ate the file reading section and everything after it for lunch so I took it out... lol if you still have problems give me your email and I will send it to you.


Edited by - krippy2k on June 10, 2001 1:23:01 AM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!