簡體   English   中英

播放音樂時如何振動iPhone

[英]How to vibrate iPhone while playing music

我試圖在通過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設置中的聲音設置? 如果聲音已關閉,則需要將聲音更改為“開啟”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM