snownskate
snownskate

Reputation: 231

Using vibrate and AVCaptureSession at the same time

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?

Upvotes: 14

Views: 1927

Answers (1)

David Karlsson
David Karlsson

Reputation: 9696

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

Upvotes: 6

Related Questions