1

I know this is what we use to make the device vibrate:

#import <AudioToolbox/AudioToolbox.h>

AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);

But how do I stop the vibration? I mean, I want a switch which activates or deactivates the vibration.

How do I do that?

Emil
  • 7,220
  • 17
  • 76
  • 135
Shishir.bobby
  • 10,994
  • 21
  • 71
  • 100

1 Answers1

2

When you use AudioServicesPlaySystemSound() there's no way to know when the sound has stopped playing. For a vibration, I believe it's a fixed length action and I don't think you can stop it in the middle of its playing.

lucius
  • 8,665
  • 3
  • 34
  • 41
  • I am not talking about stoping vibration, while running. i want provide an option to stop or to play vibration during the app/... – Shishir.bobby Jul 22 '10 at 09:30
  • Then you need to add a setting and chose wether or not to play the vibration according to that setting. – Emil Sep 25 '10 at 10:19