I’m making a drum machine. From what I’ve read, it looks like the XNA SoundEffect class runs based on a timer, which causes a noticeable lag, and stops the rhythm being smooth.
I tried to use MediaElement, ’til I found out you cannot play multiple sounds at the same time.
Are there any workarounds for this? The sounds are handled by a timer, and need to play instantly.
I’ve done some in-game use of the XNA SoundEffect class and not seen any lag when responding to user events – e.g. button presses – especially when the sound effect is pre-loaded from resources.
The XNA class is designed to be used for sound effects – so it should be ideal for a single drum machine hit.
If you then see problems with timing on IsLooping, then I guess you’ll have to implement your own timer to trigger new instances – but my advice would be to try it first.
Hope that helps