I am modifying the AurioTouch example. I want to vibrate the phone in response to particular sound inputs. I can detect the inputs and printf
them, but AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
doesn't do anything while the session is kAudioSessionCategory_PlayAndRecord
.
Enable Vibration in Accessibility Besides Sounds & Haptics, another place you need to check is your Accessibility settings. If vibration isn't enabled here, your iPhone will not vibrate on Silent or Ring mode either. Therefore, go to Settings > Accessibility > Touch, and then toggle on Vibration.
On iPhone 7 and later, go to Settings > Sounds & Haptics. On earlier iPhone models, go to Settings > Sounds. You can choose if you want your iPhone to vibrate when set to Ring or Silent mode. If you turn off both settings, your iPhone won't vibrate.
Go to Settings > Sounds & Haptics or Settings > Sounds. Select an option (like Ringtone or New Mail) under Sounds and Haptic Patterns or Sounds and Vibration Patterns. Tap Vibration, then tap Create New Vibration.
The answer is that Apple doesn't allow this. All audio sessions that allow recording turn off vibration.
Do you need to vibrate and record at the same time?
If you don't, you can stop your audio unit when it's time to vibrate, change the audio session type to live audio, play the vibrate system sound thru audio services, then switch the session back to play and record, and restart your audio unit recording again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With