AVAudioEngine offline render: Silent output only when headphones connected

試著忘記壹切 提交于 2019-12-11 19:41:37

问题


I've been working on an app that makes an audio pipeline through AVAudioEngine and then renders to a file.

I've been using this code example's approach, adapted for my own needs. The problem is that if headphones are connected to the device, the output audio file is silent. You can observe this by running that project with headphones connected.

The only idea I have is that maybe iPhone usually has a mono outputNode, but headphones give it a stereo format. I find this stuff quite hard to debug, so any pointers are appreciated.

I got that sample code from here, which may give further context on the problem.

Thanks


回答1:


Looks like the session is set for playback. Try setting it to AVAudioSessionCategoryAudioProcessing.



来源:https://stackoverflow.com/questions/34144456/avaudioengine-offline-render-silent-output-only-when-headphones-connected

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