AudioServicesAddSystemSoundCompletion回调没有得到所谓的静音模式 [英] AudioServicesAddSystemSoundCompletion callback not getting called in silent mode
问题描述
如果我使用开关把设备进入静音模式, AudioServicesAddSystemSoundCompletion
回调方法不会被调用。如果开关打开,我是说如果器件不处于静音模式,方法被称为完美
If I put device into silent mode using switch, AudioServicesAddSystemSoundCompletion
callback method doesn't get called. If the switch is on, I mean if device is NOT in silent mode, method gets called perfectly.
有没有人经历过这样的事情。这是一个错误?
Has anyone experienced something like this. Is this a bug?
推荐答案
我有同样的问题。这是不是一个错误。如果声音不播放时,由于设备被静音的回调不会被调用。
I had the same problem. It is not a bug. If the sound is not played, due to the device being muted the call back never gets called.
一个解决办法是使用一个的NSTimer是相同的长度要播放的声音。如果声音不玩计时器回调被调用。它可以执行相同的code作为回调。
A work around is to use an NSTimer that is the same length as the sound to be played. If the sound doesn't play the timer call back gets called. Which can perform the same code as your callback.
这篇关于AudioServicesAddSystemSoundCompletion回调没有得到所谓的静音模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!