14

I'm trying to vibrate the phone while recording video, but I'm finding that AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); doesn't play nicely with AVCaptureSession. Is there any other way to vibrate the phone or am I stuck with losing the vibrate function while recording video?

jscs
  • 63,095
  • 13
  • 148
  • 192
snownskate
  • 221
  • 1
  • 8

1 Answers1

6

You probably need to set the audio to mix with other, I found this useful:

- (void)setupAudio {
    [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil];
    UInt32 doSetProperty = 1;
    AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(doSetProperty), &doSetProperty);
    [[AVAudioSession sharedInstance] setActive: YES error: nil];
}

from here

Community
  • 1
  • 1
David Karlsson
  • 8,606
  • 8
  • 52
  • 96