gpt4 book ai didi

ios - 以编程方式关闭 VoiceProcessingIO AGC

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:04:41 24 4
gpt4 key购买 nike

我正在使用 Apple 的 CoreAudio 框架来录制我的麦克风馈送。自动增益控制似乎默认启用:https://developer.apple.com/library/mac/#documentation/AudioUnit/Reference/AudioUnitPropertiesReference/Reference/reference.html

kAUVoiceIOProperty_VoiceProcessingEnableAGC
Indicates whether automatic gain control is enabled (any nonzero value) or disabled (a value of 0). Automatic gain control is enabled by default.
Value is a read/write UInt32 valid on the global audio unit scope.
Available in OS X v10.7 and later.
Declared in AudioUnitProperties.h.

如何以编程方式关闭 CoreAudio 中的 AGC?

最佳答案

假设您正在使用名为 voiceProcessor 的 AUVoiceProcessor 音频单元

UInt32 turnOff = 0;
AudioUnitSetProperty(voiceProcessor,
kAUVoiceIOProperty_VoiceProcessingEnableAGC,
kAudioUnitScope_Global,
0,
&turnOff,
sizeof(turnOff));

快速解释:这样做是将音频单元上的属性设置为 0,在这种情况下会禁用 AGC。音频单元通常有两组可控值,称为属性参数。您可以使用 AudioUnitSetProperty()/AudioUnitGetProperty()AudioUnitSetParameter()/AudioUnitGetParameter() 相应地。

注意:您可能应该检查 AudioUnitSetProperty() 返回的 OSStatus 代码(如果没有,它将等于 noErr t 一个错误)。

关于ios - 以编程方式关闭 VoiceProcessingIO AGC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15644871/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com