0

i created an AVaudioplayer application and builed succeed. but no sound is working in iphone 5.1 simulator in xcode4.4.1

thanx in advance

jannath
  • 5
  • 4
  • this question is a duplicate of http://stackoverflow.com/questions/302399/sound-not-working-in-iphone-simulator/ – auco Dec 19 '12 at 15:58

2 Answers2

0

this might help.

Mac's System Preferences > Sound > Sound Effects uncheck(off) then check(on) the "Play user interface sound effects" , just check(on) it if its unchecked in default, reset it if its already checked.

janusfidel
  • 7,929
  • 4
  • 28
  • 51
0

If checking the "Play user interface sound effects" in System Preferences does not work,

try making your instance of AVAudioPlayer a global variable. This worked for me when I had the same issue when using the simulator.

you can also try calling

[audioPlayer prepareToPlay];

before

[audioPlayer play];
foolioJones
  • 647
  • 5
  • 10