iphone - 在静音模式下未调用 AudioServicesAddSystemSoundCompletion 回调

标签 iphone objective-c audio callback silent

如果我使用开关将设备置于静音模式,则不会调用 AudioServicesAddSystemSoundCompletion 回调方法。如果开关打开,我的意思是如果设备不处于静音模式,方法将被完美调用。

有没有人遇到过这样的事情。这是错误吗?

最佳答案

我遇到了同样的问题。这不是错误。如果没有播放声音,则由于设备静音,永远不会调用回叫。

解决方法是使用与要播放的声音长度相同的 NSTimer。如果声音不播放,则调用计时器回调。它可以执行与您的回调相同的代码。

关于iphone - 在静音模式下未调用 AudioServicesAddSystemSoundCompletion 回调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8289141/

相关文章:

ios - 如何检测音效何时播放完毕?

ios - UITableViewCell 滚动后数据发生变化

angular - 如何在音频对象的onerror事件中访问全局变量

ios - 找不到 Xcode Clang 错误文件

objective-c - 哪个 iOS 类/代码返回磁北?

ios - 圆弧 : how to inject custom dealloc IMP in object which in turn calls original dealloc without causing malloc error

ios - 为什么 UINavigationController 根 Controller 的 View 小于导航 Controller

java - 音频文件下采样

ios - UIUserNotificationSettings 的问题

ios - 如何解决 UIWebView 中的 "Frame Load Interrupted"错误?