Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 428
snownskate Avatar asked May 07 '13 17:05

snownskate


1 Answers

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

like image 50
David Karlsson Avatar answered Oct 22 '22 05:10

David Karlsson