AudioServicesPlaySystemSound not playing sounds

Biranchi picture Biranchi · Apr 27, 2010 · Viewed 10k times · Source

I am playing a small .wav file using the AudioToolBox.

AudioServicesPlaySystemSound (soundFileObject);

But sometimes it is not playing.

What is the reason?

Answer

lucius picture lucius · Apr 27, 2010

If you're in the Simulator, make sure that in System Prefrences → Sound, that "Play user interface sound effects" is not turned off. If you're on the device, check that the ringer switch is not set to silent.