Can't stop a playing sound
Hi,I play a sound using code taken from the well-known tutorial:
publicstatic void Play(string name)
{
Cue s = soundbank.GetCue(name);
s.Play();
}
I've got my own little routine for stopping the sound:publicstatic voidStop(string name)
{
Cue s = soundbank.GetCue(name);
s.Stop(AudioStopOptions.Immediate);
}
But the sound fails to stop. It doesn't throw any exceptions. Any clues?
[2663 byte] By [
Oaf] at [2007-12-25]
Sorted. It seems you can't stop a sound from looking up the cue using GetCue - you have to use the original Cue you invoked the Play() command on. It seems the two are different! :D
Anyway, I've just posted a demo game up on my site.
*Blatent self publicity - turn away now!*
I'm a mobile games developer/publisher, and I've been tinkering with XNA for the last few weeks. I've a thing called Platform, which allows me to write a game once, then target that code against desktop Java and the hundreds of j2me mobile phones out there.
Anyway, I've written an XNA version. With C# being very similar to Java I can now practically take my Java source and plop it straight into an XNA project. I've always been a fan of MS tools, so now I'm looking to develop games the other way round from now on - lead dev on XNA, then port to Java afterwards.
The demo, info about the game, lots of other games, and info about me are all available at www.cheeky.gr.
Many thanks,
Mark
Oaf at 2007-9-3 >
