I'm trying to take sound effects I have made and put them into my game. I have a sound like walking that I want to loop while the user is walking and once the user stops walking, I want the sound to stop. I went through the DirectX tutorials on using XACT but it does not answer my question. In my code I try to use the play function and when they are not moving i stop the walking sound. What happens with this is it just plays the whole sound clip even when i stop moving.
Asked
Active
Viewed 871 times
1 Answers
0
Are you using the XACT_FLAG_STOP_IMMEDIATE
flag?

AShelly
- 34,686
- 15
- 91
- 152
-
AHH I see now I was able to get it to stop imdiatly. I was just passing 0 to that flag. – Katianie Apr 27 '11 at 19:15
-
Now i Need to figure out how to loop the sound when it compleats as long as the user is moving. – Katianie Apr 27 '11 at 19:17
-
The wave file itself can be marked as looping, or you can set `nLoopCount` to a big number when you PrepareWave. – AShelly Apr 27 '11 at 19:24
-
http://msdn.microsoft.com/en-us/library/bb203895(XNAGameStudio.20).aspx - look for the section where you can set the wave properties to Infinite looping. – AShelly Apr 27 '11 at 19:47