1

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?

17
  • Just curious, does sound work on this iPad in other apps? Can you try AVAudioPlayer as a test to see if it works? (I wouldn't use it in your final game, however, just a test) Aug 15, 2012 at 1:52
  • My 2 year old found mute on my iPad the other day. I didn't even know there was such a thing, but it made it look like my iPad couldn't play sound. I think he found it by swiping left after double-tapping the home button.
    – sblom
    Aug 15, 2012 at 5:30
  • Yes, sound works fine in other apps. I don't know how to use AVAudioPlayer. Is there a way to verify without having to change to that?
    – user856232
    Aug 15, 2012 at 5:30
  • It is very simple, try one of the examples here: stackoverflow.com/questions/1757768/… SystemSound will work also. Aug 15, 2012 at 11:57
  • Did you configure you AudioSession, to notify the OS about the kind of audio that you will be playing back? Aug 15, 2012 at 14:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.