Direct Audio: Playing more than one sound file at once

Started by
4 comments, last by Rathga 22 years, 10 months ago
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
Advertisement
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.

soundperformance->PlaySegmentEx(
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

Seeya
Krippy
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?

Thanks

rath
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.

lol
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.

Seeya
Krip


Edited by - krippy2k on June 10, 2001 1:23:01 AM
excellent! it works!

Thanks a lot for your help

rath
Anytime

This topic is closed to new replies.

Advertisement