【问题标题】:How to vibrate iPhone while playing music如何在播放音乐时振动 iPhone
【发布时间】:2011-01-17 10:58:38
【问题描述】:

我在使用 MediaPlayer 框架播放 iPod 音乐时尝试使用 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) 振动 iPhone,但在播放音乐时我无法让振动工作。我可以使用以下代码在播放 iPod 音乐的同时播放声音,但振动似乎不起作用。

[musicPlayerController play];    // play the iPod music

AudioServicesPlaySystemSound(mySoundFileID);    // this function works fine -- it plays an aif sound while the music is playing
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);    // But this line doesn't do anything!

有人对我有什么建议吗?非常感谢!

【问题讨论】:

    标签: iphone vibration iphone-vibrate


    【解决方案1】:

    你检查过iphone设置里的声音设置了吗?您需要在声音下将振动设置为 ON,以防它关闭。

    【讨论】:

      猜你喜欢
      • 2017-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多