iPhone does not vibrate while recording

2020-06-17 05:00发布

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.

2条回答
Bombasti
2楼-- · 2020-06-17 05:36

The answer is that Apple doesn't allow this. All audio sessions that allow recording turn off vibration.

查看更多
3楼-- · 2020-06-17 05:46

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.

查看更多
登录 后发表回答