1

我在带有 iOS 7 的 iPhone 4 上进行了测试,似乎 AudioServicesPlaySystemSound 和 AudioServicesPlayAlertSound 都不再工作了。

4

1 回答 1

4

两者都AudioServicesPlaySystemSound适合AudioServicesPlayAlertSound我。你确定吗

  • 您的手机未处于静音模式
  • 您手机的音频电平不为零
  • 您尝试播放的声音是有效的(检查AudioServicesCreateSystemSoundID返回的错误)

我在https://github.com/st3fan/StackOverflow/tree/master/SystemSounds上放了一些代码,这些代码适用于我在模拟器中的 iOS 7.0.2 和 iPhone 5 上。

于 2013-10-20T14:44:02.623 回答