在iOS中使用Core Audio同时播放和录制 [英] Playback and Recording simultaneously using Core Audio in iOS

查看:145
本文介绍了在iOS中使用Core Audio同时播放和录制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Core Audio同时播放和录制。我真的不想使用AVFoundation API(AVAudioPlayer + AVAudioRecorder)这样做,因为我正在创建一个音乐应用程序,并且不会有任何延迟问题。

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.

我看了来自Apple的以下源代码:

aurioTouch

MixerHost

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

我已经查看了以下帖子:

iOS:同步录制和播放的示例代码

同时录制和播放音频

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

我仍然不清楚如何做playbac k并使用Core Audio同时录制相同的内容。任何有关如何实现这一目标的指示都将非常值得注意。任何示例源代码的指针也会有很大帮助。

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.

推荐答案

RemoteIO音频单元可用于同步记录和玩。有很多使用RemoteIO(aurioTouch)录制和使用RemoteIO播放的例子。只需启用单位输入和单位输出,并处理两个缓冲区回调。查看示例此处

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

这篇关于在iOS中使用Core Audio同时播放和录制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆