开发者

Overriding iOS system volume to play alarm

I have an alarm application and if user reduces the phone volume using the hardware keys the alarm volume also gets affected. I have noticed few of the other alarm applications raising alarm ev开发者_运维技巧en if system volume is zero or muted. How i can achieve the same? iam currently using both AVAudioPlayer & MPMusicPlayerController for playing audio.


You can set volume on both MPMusicPlayerController and on AVAudioPlayer.

For example:

MPMusicPlayerController *musicPlayer = [MPMusicPlayerController applicationMusicPlayer];
musicPlayer.volume = 1.0;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜