Possible duplicate:Programmatically disable / disconnect an iOS device?
I need to programmatically disable the device volume. Does anyone know a way?
So far, I have discovered that perhaps I can use the AudioSessionSetProperty () function and use the "kAudioSessionProperty_CurrentHardwareOutputVolume" property, but this property is read-only. I'm not sure if this will work:
float value = 0.0f; AudioSessionSetProperty(kAudioSessionProperty_CurrentHardwareOutputVolume, sizeof(float), &value);
There are already applications in the App-Store, for example, AutoSilent:
http://itunes.apple.com/nl/app/autosilent/id474777148?mt=8
iOS. iOS - . , .
: iOS
: / iOS-?
, , Celestial. AVSystemController, :
AVSystemController
[[AVSystemController sharedAVSystemController] setVolumeTo:0 forCategory:@"Ringtone"];
, . , Apple ( ), App Store, , .
, !