How to add two I/O audio Unit
in AUGraph in iOS ?
One I/O AudioUnit
take the record input, another take the playback output.
Asked
Active
Viewed 255 times
2 Answers
1
iOS currently only allows using one Audio Unit for I/O, RemoteIO. However, the RemoteIO Audio Unit can be connected to an AUGraph to do both recording audio input and playing audio output at the same time. The audio routing can be configured through the Audio Session API.

hotpaw2
- 70,107
- 14
- 90
- 153
-1
If the record is a file, then I found this post very useful http://www.ithinkers.com.ua/blog-en/2017/3/16/how-to-make-offline-render-audio
// EDIT: after comments some explanation
The solution described by the link above is based on file to file conversion. So basically if you need a solution "file to output (speakers" you need to fiddle out around output node connection in augraph with this description
//
static var outputDescription:AudioComponentDescription {
//
var theType:OSType
//
#if (os(iOS))
theType = kAudioUnitSubType_RemoteIO
#else
theType = kAudioUnitSubType_DefaultOutput
#endif
return AudioComponentDescription(componentType: kAudioUnitType_Output,
componentSubType: theType,
componentManufacturer: kAudioUnitManufacturer_Apple,
componentFlags: 0,
componentFlagsMask: 0)
}

Vanya
- 4,973
- 5
- 32
- 57
-
A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](//stackoverflow.com/help/deleted-answers) – Paul Roub Feb 01 '18 at 22:39