Here is my code:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using System.IO;
Stream stream = TitleContainer.OpenStream("sounds/BEEP.WAV");
SoundEffect effect = SoundEffect.FromStream(stream);
FrameworkDispatcher.Update();
effect.Play();
I get InvalidOperationException in line “SoundEffect effect = SoundEffect.FromStream(stream)”
Any ideas how to fix it?
According to the MSDN documentation, the file pointed to by stream has very specific requirements: