Eamon Ford
Eamon Ford

Reputation: 1

How to vibrate iPhone while playing music

I am trying to vibrate the iPhone using AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) while playing iPod music with the MediaPlayer framework, but I can't get the vibrate to work while the music is playing. I can play a sound at the same time as the iPod music using the following code, but the vibrate doesn't seem to work.

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

Does anyone have any suggestions for me? Thanks a lot!

Upvotes: 0

Views: 2241

Answers (1)

MCAmri
MCAmri

Reputation: 91

Have you checked the sound setting in iphone setting? You need to changed vibrate to ON under sounds, in case it turned OFF.

Upvotes: 1

Related Questions