How to programmatically silence the ringer or change the ringer tone on iOS5

后端 未结 2 688
南方客
南方客 2020-12-18 07:34

Is there a way to reduce the volume of the ringer or change the ringer tone on iOS5?

I checked out the Celestial framework, but can\'t instantiate AVSystemControlle

相关标签:
2条回答
  • 2020-12-18 07:59

    Yes. Use AVSystemController. You don't instantiate it. It's a singleton.

    http://code.google.com/p/iphone-dev/source/browse/trunk/include/include/Celestial/AVSystemController.h?r=136

    [[AVSystemController sharedAVSystemController] setVolumeTo:10.0 forCategory:@"Ringtone"];
    
    0 讨论(0)
  • 2020-12-18 07:59

    This might be what you are looking for: Override ringer volume in iPhone apps

    Basically, you set the volume using AVAudioPlayer on the -(void)viewDidLoad method of the view you are displaying on

    0 讨论(0)
提交回复
热议问题