views:

248

answers:

0

I'm trying to get my iPhone to vibrate while I'm recording.

I've tried this:

UInt32 category = kAudioSessionCategory_PlayAndRecord; 
status |= AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &category);
UInt32 allowMixing = true;
status |= AudioSessionSetProperty (
      kAudioSessionProperty_OverrideCategoryMixWithOthers,  // 1
      sizeof (allowMixing),                                 // 2
      &allowMixing                                          // 3
       );
status |= AudioSessionSetProperty(
      kAudioSessionProperty_OtherMixableAudioShouldDuck, // 1
      sizeof (allowMixing),        // 2
      &allowMixing          // 3
       );

As suggested here. Then vibrate the device later on by calling

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

But it does not work. But it does not vibrate. It records fine, and if I call a vibrate moments before I stop recording it vibrates after stop it.

Apparently it's a bug, does anyone know of a work around?