iPhone does not vibrate while recording

徘徊边缘 提交于 2019-12-04 23:02:50

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/3589294/iphone-does-not-vibrate-while-recording

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!