How can I play sound effects in a game created with the universal app template (so it runs on both Windows 8.1 and Windows Phone 8.1) programmatically?
I need to play the sound from a GameManager class I've created.
How can I play sound effects in a game created with the universal app template (so it runs on both Windows 8.1 and Windows Phone 8.1) programmatically?
I need to play the sound from a GameManager class I've created.
Note that MediaElement
is designed mostly to play a single audio track so you'd need to manage a pool of these to play more than one at a time and also its latency might not be low enough. I'd look into XAudio2 if you'd be OK with some C++ or its SharpDX wrapper for C# or just use MonoGame's SoundEffect
class that makes things easy.