我在 API 19 Android 模拟器上测试的 MonoGame 项目中有一系列音效实例。音效从“Assets/Content”文件夹中名为“Sound”的文件夹加载。它们都是“.wav”格式。我不知道如何使音效正常播放。模拟器上的音量设置为满,我已经使用 XNA 4.0 for Windows Phone 测试了代码,没有任何问题。我该如何解决这个问题?
SoundEffectInstance[] soundEffects = new SoundEffectInstance[5];
soundEffects[0] = Content.Load<SoundEffect>("Sound/1").CreateInstance();
soundEffects[0].Play(); //This should play the sound effect, but no sound comes from the emulator
注意:即使我改用“SoundEffect”类型,也不会产生声音。
SoundEffect[] soundEffects = new SoundEffect[5];
soundEffects[0] = Content.Load<SoundEffect>("Sound/1");
soundEffects[0].Play();