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,694
  • 13
  • 151
  • 195
snownskate
  • 231
  • 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
  • 9,396
  • 9
  • 58
  • 103