Original Post
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
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()
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!
g_pSongseg->SetRepeats(DMUS_SEG_REPEAT_INFINITE); PlayS(g_pSongseg);//PlayS() just encapsulates the PlaySegmentEx()
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.
);
}