I know that I can reference XNA for the SoundEffect class and what I have done so far, but I was wondering if there was a better way than what I did.
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using (var stream = TitleContainer.OpenStream("test.mp3"))
{
var effect = SoundEffect.FromStream(stream);
FrameworkDispatcher.Update();
effect.Play();
}
For my test application, I have 20 sounds, every 1 second, which I want to play when the button is pressed. I play with different tricks, but if possible, I would like to know how professionals do this before making an application based on the sound effect. Small things, such as loading a sound effect or loading it, a button will be pressed, a pressed button.
Thank.
source
share