Skip to main content
GameDev.net gamedev.net
🔒 Locked

Directx Audio help please

Started by jakerrz Dec 19, 2002 at 9:57 PM 1 replies 500+ views
Original Post
jakerrz
jakerrz
Hello, I am trying to learn Directx Audio, I am having a little problem with playing my sounds. I have a background song that i want to loop. and one other sound for when you click a button. i use this code when i call the song segment
  
g_pSongseg->SetRepeats(DMUS_SEG_REPEAT_INFINITE);
PlayS(g_pSongseg);//PlayS() just encapsulates the PlaySegmentEx()

  
now that plays and loops fine until i click a button and then the song is inturupted by the sound of the button. but if i set the dwflags for PlaySegmentEx to DMUS_SEGF_NOINVALIDATE the other sound no longer interupts my song but now the song doesn''t loop anymore... now here is the source for my PlayS()
  
void PlayS(IDirectMusicSegment8* pSegment)
{
 
 g_pPerformance->PlaySegmentEx(
    pSegment,  // Segment to play.

    NULL,    // Used for songs; not implemented.

    NULL,    // For transitions. 

    0,      // or DMUS_SEGF_NOINVALIDATE,     // Flags.

    0,     // Start time; 0 is immediate.

    NULL,    // Pointer that receives segment state.

    NULL,    // Object to stop.

    NULL   // Audiopath, if not default.

  );  
}
  
my question is how can i make the background music loop using the g_pSongseg->SetRepeats(DMUS_SEG_REPEAT_INFINITE); without it being interupted by my other sounds. i hope my explaination wasn''t to confusing... thanks for any help!
jakerrz
jakerrz
what is a secondary sound?
like sound effects?

does it default to primary?

and should i still use DMUS_SEGF_NOINVALIDATE with the DMUS_SEGF_SECONDARY flag

thanks

Topic Locked

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

Sign in to reply to this topic.