You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用kAudioUnitSubType_VoiceProcessingIO为何音量低于RemoteIO?如何解决?

Hey, I’ve run into this exact issue before! The core problem here is that kAudioUnitSubType_VoiceProcessingIO is built specifically for voice call scenarios (like VoIP), so it ships with default settings that prioritize clear, distortion-free speech over maximum volume. Let’s break down the root causes and actionable fixes:

Why the Volume Is Lower
  • Auto Gain Control (AGC) is enabled by default: VoiceProcessingIO’s AGC algorithm actively suppresses loud signals and boosts quiet ones to keep audio at a "conversational" level. This is great for calls, but it crushes the volume range you’d want for media playback or high-fidelity recording.
  • Echo Cancellation (AEC) side effects: To eliminate call echo, the unit applies additional signal processing that can subtly reduce overall volume as a byproduct.
  • Default audio routing: For playback, VoiceProcessingIO often defaults to the earpiece (instead of the loudspeaker) to match call behavior, making the volume feel much lower than when using RemoteIO.
How to Fix It

Here are the most effective solutions, ordered by impact:

1. Disable Auto Gain Control (AGC)

This is the quickest fix. You can either bypass all voice processing entirely, or just turn off AGC while keeping other features like AEC if needed:

Bypass all voice processing

AudioUnit voiceIOUnit; // Your initialized VoiceProcessingIO instance
OSStatus status;

UInt32 bypassVoiceProcessing = 0;
status = AudioUnitSetProperty(voiceIOUnit,
                              kAUVoiceIOProperty_BypassVoiceProcessing,
                              kAudioUnitScope_Global,
                              0,
                              &bypassVoiceProcessing,
                              sizeof(bypassVoiceProcessing));
if (status != noErr) {
    NSLog(@"Failed to bypass voice processing: %d", (int)status);
}

Only disable AGC (keep other features)

UInt32 disableAGC = 0;
status = AudioUnitSetProperty(voiceIOUnit,
                              kAUVoiceIOProperty_DisableAGC,
                              kAudioUnitScope_Global,
                              0,
                              &disableAGC,
                              sizeof(disableAGC));

2. Force Audio Routing to the Loudspeaker (Playback Scenarios)

If playback volume is low, chances are the audio is coming through the earpiece. Force it to use the loudspeaker via the AVAudioSession:

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *sessionError;

// Set category to PlayAndRecord with default speaker option
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord 
               withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker 
                     error:&sessionError];
if (sessionError) {
    NSLog(@"Failed to set audio session category: %@", sessionError.localizedDescription);
}

[audioSession setActive:YES error:&sessionError];

3. Manually Adjust Gain

If disabling AGC still isn’t enough, you can manually crank up the input/output gain. Just be careful not to set it too high (this causes clipping/distortion):

// Adjust input gain (range: -160.0 to 0.0 dB; 0.0 is maximum)
Float32 inputGain = 0.0f;
AudioUnitSetProperty(voiceIOUnit,
                     kAudioUnitProperty_Gain,
                     kAudioUnitScope_Input,
                     0,
                     &inputGain,
                     sizeof(inputGain));

// Adjust output gain (1.0 = original volume; values >1.0 amplify, but risk distortion)
Float32 outputGain = 1.5f;
AudioUnitSetProperty(voiceIOUnit,
                     kAudioUnitProperty_Gain,
                     kAudioUnitScope_Output,
                     0,
                     &outputGain,
                     sizeof(outputGain));

4. Disable Noise Suppression (If Needed)

Noise suppression (another default feature for calls) can also reduce volume. Turn it off if you don’t need it:

UInt32 disableNS = 0;
AudioUnitSetProperty(voiceIOUnit,
                     kAUVoiceIOProperty_DisableNS,
                     kAudioUnitScope_Global,
                     0,
                     &disableNS,
                     sizeof(disableNS));
Quick Note

If your use case doesn’t require voice call-specific features (like echo cancellation or noise suppression), consider sticking with RemoteIO. It’s lighter on system resources and doesn’t apply these volume-limiting processing steps by default.

内容的提问来源于stack exchange,提问作者cnskt

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:14:33