Sound not working in iOS for iPad

蓝咒 提交于 2019-12-11 09:49:44

问题


My game works fine in the simulator and on an actual iPod Touch device, but when I run it on my iPad 2 device the sound doesn't play and the sound effects don't play.

Here is my code to start up the background music. Keep in mind this works on the simulator AND on an actual iPod Touch device:

SoundEffect.MasterVolume = 1.0f;

SoundEffect soundMusic = (new ContentManager(screenManager.Game.Services, "Content")).Load<SoundEffect>("Music");
SoundEffectInstance soundMusicInstance = soundMusic.CreateInstance();

soundMusicInstance.IsLooped = true;
soundMusicInstance.Play();

Why doesn't this work on iPad?

来源:https://stackoverflow.com/questions/11963098/sound-not-working-in-ios-for-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!