Playback and Recording simultaneously using Core Audio in iOS

寵の児 提交于 2019-12-04 11:31:39

问题


I need to play and record simultaneously using Core Audio. I really do not want to use AVFoundation API (AVAudioPlayer + AVAudioRecorder) to do this as I am making a music app and cannot have any latency issues.

I've looked at the following source code from Apple:
aurioTouch
MixerHost

I've already looked into the following posts:
iOS: Sample code for simultaneous record and playback
Record and play audio Simultaneously

I am still not clear on how I can do playback and record the same thing simultaneously using Core Audio. Any pointers towards how I can achieve this will be greatly appreciable. Any pointers to any sample source code will also be of great help.


回答1:


The RemoteIO Audio Unit can be used for simultaneous record and play. There are plenty of examples of recording using RemoteIO (aurioTouch) and playing using RemoteIO. Just enable both unit input and unit output, and handle both buffer callbacks. See an example here



来源:https://stackoverflow.com/questions/12202110/playback-and-recording-simultaneously-using-core-audio-in-ios

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