views:

45

answers:

1

Hello there,

is there any way to play a short sound and let the phone vibrate at the same time? I found something about AudioQueing, but I'm a newbie and cant wrap my head around that whole process of AudioQueing.

Kind regards from Germany

A: 

Yes. What part do you have problems with? Playing sounds, vibrating, or doing both at once? For playing short sounds you can use the AVAudioPlayer class. The vibration is triggered by the following code:

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

Described here, for example.

zoul
Tried it, but it doesn't play a sound, just produces some kind of freeze for 1-2s, then everything works like it should... But thanks, I'll have to investigate what's the problem with this freeze
elusive