Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

XNA "SoundEffect" Issues...

$
0
0
Basically, this sound won't stop playing when I release the mouse left click button. But it should. No errors, it just doesn't work. Ideas?

SoundEffectInstance c4soundsf = C4Sound.CreateInstance();
                if (mouseState.LeftButton == ButtonState.Pressed && previousMouseState.LeftButton != ButtonState.Pressed)
                {
                    c4soundsf.Play();
                }
                if (mouseState.LeftButton != ButtonState.Pressed && previousMouseState.LeftButton == ButtonState.Pressed)
                {
                    c4soundsf.Stop(true);
                    c4soundsf.Dispose();
                }


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>