Tap the screen > play a sound effect.
Tap the screen again > stop the sound effect if it's still playing.
Sounds simple, right? Well, tapping the screen plays the sound effect each time no matter what. So, the end result is the same sound effect playing simultaneously.
I pieced this together and think i know what the problem is: Each time the Instance is Created, the SoundState defaults to Stop.
Protected Overrides Sub OnManipulationStarted(args As ManipulationStartedEventArgs)
Private Sub PlaySound()
Dim sei As SoundEffectInstance
Dim stream As IO.Stream = TitleContainer.OpenStream("Sounds/error.wav")
Dim effect As SoundEffect = SoundEffect.FromStream(stream)
sei = effect.CreateInstance()
If sei.State = SoundState.Playing Then
Any ideas on how to acheive the desired effect as descibed in the begging of this post?