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?
Asked
Active
Viewed 1,819 times
14

jscs
- 63,694
- 13
- 151
- 195

snownskate
- 231
- 1
- 8
-
I would think vibration would negatively affect the quality of the captured video. This could be why it's disabled. – picciano May 07 '13 at 20:03
-
@picciano It's not just vibrate though, its any system sound – Eric May 13 '13 at 17:13
1 Answers
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
-
can u please explain me how to do it??? i want to vibrate the phone while recording the video... please guide me – BhavikKama Jan 11 '14 at 06:53
-
here is my question http://stackoverflow.com/questions/21059607/how-to-use-vibration-while-recording-iphone5-ios – BhavikKama Jan 11 '14 at 07:04
-
Hello @User1531343, Did you find any solution? I want to implement same feature in my app. – Diken Shah Aug 05 '20 at 06:59