If you are playing a short system sound (shorter than 30 seconds) using the System Sound Services mechanism (code would look something like the following)
#include <AudioToolbox/AudioToolbox.h>
SystemSoundID aSoundID;
/* Setup */
SystemSoundID aSoundID;
OSStatus error =
AudioServicesCreateSystemSoundID((CFURLRef)aFileURL, &aSoundID);
if (error == kAudioServicesNoError) { // success
_soundID = aSoundID;
}
/* Play */
AudioServicesPlaySystemSound(aSoundID);
/* Dispose */
AudioServicesDisposeSystemSoundID(aSoundID);
You can use AudioServicesSetProperty to set two properties using this function.
They are:
kAudioServicesPropertyIsUISound = 'isui',
kAudioServicesPropertyCompletePlaybackIfAppDies = 'ifdi'
kAudioServicesPropertyIsUISound, if it is set to 1 means that, for the audio file specified by a system sound passed in the inSpecifier parameter, the System Sound server respects the user setting in the Sound Effects preference and is silent when the user turns off sound effects.
This property is set to 1 by default. Set it to 0 for the system sound to always play when passed to AudioServicesPlaySystemSound, regardless of the user's setting in sound preferences.
kAudioServicesPropertyCompletePlaybackIfAppDies, if it is set to 1 means that the audio file specified by a system sound passed in the inSpecifier parameter should finish playing even if the client application terminates. This could happen, for example, if the user quits or the application terminates unexpectedly while the sound is playing. The default is 0. That is, you must explicitly set this property’s value to 1 if you want the sound to complete playing even if the application terminates.
EDIT: Upon re-reading your question, it seems it may be more "How do I set a property" than "what does this thing do" In this case, the following will be more useful:
Assuming you set up the sound as I specified above, you could set this particular SystemSoundID object to ignore the "silent" setting on the side of the phone by doing the following:
UInt32 flag = 0;
err = AudioServicesSetProperty(kAudioServicesPropertyIsUISound,
sizeof(UInt32),
&aSoundID,
sizeof(UInt32),
&flag);