views:

71

answers:

1

How can I play two or three vibrates in a row? Or different patterns of vibrate?

Repeating AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) does not work. Only does a single vibrate.

Tried using callback

    OSStatus AudioServicesAddSystemSoundCompletion (
                                                SystemSoundID                           kSystemSoundID_Vibrate,
                                                CFRunLoopRef                            inRunLoop,
                                                CFStringRef                             inRunLoopMode,
                                                AudioServicesSystemSoundCompletionProc  vibrationDone,
                                                void                                    *inClientData
                                                );

but it does not trigger vibrationDone.

+1  A: 

Try registering a callback using AudioServicesAddSystemSoundCompletion to be notified when the vibrate "sound" has ended before attempting to play it another time. From the docs:

Because a system sound may play for several seconds, you might want to know when it has finished playing. For example, you may want to wait until a system sound has finished playing before you play another sound.

NB: I haven't tried if this actually works.

Ole Begemann