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:
http://itunes.apple.com/nl/app/autosilent/id474777148?mt=8
You can't do this with iOS. The only way to mute an iOS device is by using the hardware switch. You can detect it and mute your app accordingly, but can't mute the entire device from your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With