Possible Duplicate:
Mute/Silence an iOS device programmatically?
I need to turn off the device volume programmatically. Does anyone know a way?
So far I have discovered, that maybe i can use AudioSessionSetProperty() function, and use the property "kAudioSessionProperty_CurrentHardwareOutputVolume", but this property is only read only. SO i am not sure if this will work:
float value = 0.0f;
AudioSessionSetProperty(kAudioSessionProperty_CurrentHardwareOutputVolume, sizeof(float), &value);
There are already apps in the App-Store that does this, e.g. AutoSilent: