2010-07-07 281 views
0

我想在使用MediaPlayer框架播放iPod音樂時使用AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)振動iPhone,但播放音樂時無法使用振動功能。我可以使用以下代碼在iPod音樂的同時播放聲音,但振動似乎不起作用。如何在播放音樂時振動iPhone

[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! 

有沒有人對我有任何建議?非常感謝!

回答

1

你是否檢查過iPhone設置中的聲音設置?您需要在聲音下將振動更改爲開啓,以防萬一它關閉。