Is it safe to use two audio devices for simultaneous input-output in iOS?

I am working on a VOIP project for iOS and I notice a strange problem. My setup is as follows:

  • At the end of the capture there is a VoiceProcessingIO module (for echo cancellation), with an output area, an output bus and an input area, the input bus is turned on.
  • At the end of the Render there is a RemoteIO module with an output area, the output bus is on.

I do not use any sound graphics yet.

When I start recording voice, I noticed that the above setting caused a very low output voice until I turn off the output volume, the VoiceProcessingIO output bus. Although this sounds like an error in my code (setting the wrong I / O bus), there is no sense why the change at the end of the capture affects the completion of the rendering.

After reading the developer.apple.com iOS audio device placement guide, I noticed that he mentioned many times that each design template should include only one audio input / output block. I am wondering if this is mandatory or just optional. Is it safe to save code with two audio devices?

Indeed, the use of two audio devices may have its own reason, since I can simply disconnect one block if I want to disconnect one end. I cannot do this with kAudioUnitProperty_EnableIO, because it cannot be changed after AudioUnitInitialize (), which means that to solve one audio device, you may need to disable both channels and reinitialize the audio device if I want to disable one of them. This causes a bad user experience, because the voice may temporarily pause during this moment.

Thanks Fuzhou

+3
source share
3 answers

Well, it looks like I'm asking a corner question. Anyway, I think I have some ideas based on my experiments so far:

  • RemoteIO... , . , , VOIP? , , .

  • VoiceProcessingIO... , , . , , (, ), .

  • VoiceProcessingIO RemoteIO... . -, VoiceProcessingIO . . VoiceProcessingIO RemoteIO . , . , VoiceProcessingIO, .

, iOS. Mac.

, , , , , - Apple Audio Unit Hosting Guide.

, . , , - .

+1

, , , , - , , .

: " , VoiceProcessingIO, ". IO :

flag = 0;
status = AudioUnitSetProperty(_recordAudioUnit,
                              kAudioOutputUnitProperty_EnableIO,
                              kAudioUnitScope_Output,
                              kOutputBus,
                              &flag,
                              sizeof(flag));

, , , .

, , .

0

AUGraph

kAUGraphErr_OutputNodeErr AUGraphs can contain only one OutputUnit. this error is returned when you try to add a second output block or the graph output block is deleted while the graph is running

AUGraph.h line 106

0
source

All Articles