Skip to content

Commit

Permalink
Replace WebRTC gaincontroller2 r4332 by r6818
Browse files Browse the repository at this point in the history
Replaces WebRTCAudioPreprocessor::gaincontroller2:

struct
{
    TTBOOL bEnable;
    float fInitialSaturationMarginDB;
    float fExtraSaturationMarginDB;
    float fMaxGainChangeDBPerSecond;
    float fMaxOutputNoiseLevelDBFS;
} adaptivedigital;

By:

struct
{
    TTBOOL bEnable;
    float fHeadRoomDB;
    float fMaxGainDB;
    float fInitialGainDB;
    float fMaxGainChangeDBPerSecond;
    float fMaxOutputNoiseLevelDBFS;
} adaptivedigital;
  • Loading branch information
bear101 committed Nov 24, 2024
1 parent 92f3303 commit 493b498
Show file tree
Hide file tree
Showing 17 changed files with 139 additions and 99 deletions.
13 changes: 2 additions & 11 deletions Client/TeamTalkClassic/TeamTalkBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,7 @@ AudioPreprocessor InitDefaultAudioPreprocessor(AudioPreprocessorType preprocesso
preprocessor.ttpreprocessor.bMuteLeftSpeaker = preprocessor.ttpreprocessor.bMuteRightSpeaker = FALSE;
break;
case WEBRTC_AUDIOPREPROCESSOR:
preprocessor.webrtc.gaincontroller2.bEnable = DEFAULT_WEBRTC_GAINCTL_ENABLE;
preprocessor.webrtc.gaincontroller2.fixeddigital.fGainDB = DEFAULT_WEBRTC_GAINDB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.bEnable = DEFAULT_WEBRTC_SAT_PROT_ENABLE;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fInitialSaturationMarginDB = DEFAULT_WEBRTC_INIT_SAT_MARGIN_DB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fExtraSaturationMarginDB = DEFAULT_WEBRTC_EXTRA_SAT_MARGIN_DB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxGainChangeDBPerSecond = DEFAULT_WEBRTC_MAXGAIN_DBSEC;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxOutputNoiseLevelDBFS = DEFAULT_WEBRTC_MAX_OUT_NOISE;
preprocessor.webrtc.noisesuppression.bEnable = DEFAULT_WEBRTC_NOISESUPPRESS_ENABLE;
preprocessor.webrtc.noisesuppression.nLevel = DEFAULT_WEBRTC_NOISESUPPRESS_LEVEL;
preprocessor.webrtc.echocanceller.bEnable = DEFAULT_WEBRTC_ECHO_CANCEL_ENABLE;
case WEBRTC_AUDIOPREPROCESSOR_OBSOLETE_R4332 :
break;
}
return preprocessor;
Expand Down Expand Up @@ -338,4 +329,4 @@ void UserCached::Sync(TTInstance* ttInst, const User& user)
TT_PumpMessage(ttInst, CLIENTEVENT_USER_STATECHANGE, user.nUserID);

TRACE(_T("Restored ") + UserCacheID(user) + _T("\n"));
}
}
12 changes: 7 additions & 5 deletions Client/iTeamTalk/iTeamTalk/UtilTT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ let DEFAULT_WEBRTC_LEVELESTIMATION_ENABLE = FALSE
let DEFAULT_WEBRTC_GAINCTL_ENABLE = DEFAULT_AGC_ENABLE
let DEFAULT_WEBRTC_GAINDB = Float(15)
let DEFAULT_WEBRTC_SAT_PROT_ENABLE = TRUE
let DEFAULT_WEBRTC_INIT_SAT_MARGIN_DB = Float(20)
let DEFAULT_WEBRTC_EXTRA_SAT_MARGIN_DB = Float(2)
let DEFAULT_WEBRTC_MAXGAIN_DBSEC = Float(3)
let DEFAULT_WEBRTC_HEADROOM_DB = Float(5)
let DEFAULT_WEBRTC_MAXGAIN_DB = Float(50)
let DEFAULT_WEBRTC_INITIAL_GAIN_DB = Float(15)
let DEFAULT_WEBRTC_MAXGAIN_DBSEC = Float(6)
let DEFAULT_WEBRTC_MAX_OUT_NOISE = Float(-50)
let DEFAULT_WEBRTC_NOISESUPPRESS_ENABLE = DEFAULT_DENOISE_ENABLE
let DEFAULT_WEBRTC_NOISESUPPRESS_LEVEL = INT32(2)
Expand Down Expand Up @@ -299,8 +300,9 @@ func newAudioPreprocessor(preprocessor: AudioPreprocessorType) -> AudioPreproces
ap.webrtc.gaincontroller2.bEnable = DEFAULT_WEBRTC_GAINCTL_ENABLE
ap.webrtc.gaincontroller2.fixeddigital.fGainDB = DEFAULT_WEBRTC_GAINDB
ap.webrtc.gaincontroller2.adaptivedigital.bEnable = DEFAULT_WEBRTC_SAT_PROT_ENABLE
ap.webrtc.gaincontroller2.adaptivedigital.fExtraSaturationMarginDB = DEFAULT_WEBRTC_EXTRA_SAT_MARGIN_DB
ap.webrtc.gaincontroller2.adaptivedigital.fInitialSaturationMarginDB = DEFAULT_WEBRTC_INIT_SAT_MARGIN_DB
ap.webrtc.gaincontroller2.adaptivedigital.fHeadRoomDB = DEFAULT_WEBRTC_HEADROOM_DB
ap.webrtc.gaincontroller2.adaptivedigital.fMaxGainDB = DEFAULT_WEBRTC_MAXGAIN_DB
ap.webrtc.gaincontroller2.adaptivedigital.fInitialGainDB = DEFAULT_WEBRTC_INITIAL_GAIN_DB
ap.webrtc.gaincontroller2.adaptivedigital.fMaxGainChangeDBPerSecond = DEFAULT_WEBRTC_MAXGAIN_DBSEC
ap.webrtc.gaincontroller2.adaptivedigital.fMaxOutputNoiseLevelDBFS = DEFAULT_WEBRTC_MAX_OUT_NOISE
ap.webrtc.levelestimation.bEnable = DEFAULT_WEBRTC_LEVELESTIMATION_ENABLE
Expand Down
24 changes: 14 additions & 10 deletions Client/qtTeamTalk/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,10 @@ AudioPreprocessor loadAudioPreprocessor(AudioPreprocessorType preprocessortype)
AudioPreprocessor preprocessor = initDefaultAudioPreprocessor(preprocessortype);
switch (preprocessor.nPreprocessor)
{
case NO_AUDIOPREPROCESSOR:
case NO_AUDIOPREPROCESSOR :
case WEBRTC_AUDIOPREPROCESSOR_OBSOLETE_R4332 :
break;
case SPEEXDSP_AUDIOPREPROCESSOR:
case SPEEXDSP_AUDIOPREPROCESSOR :
preprocessor.speexdsp.bEnableAGC = ttSettings->value(SETTINGS_STREAMMEDIA_SPX_AGC_ENABLE, DEFAULT_SPEEXDSP_AGC_ENABLE).toBool();
preprocessor.speexdsp.nGainLevel = ttSettings->value(SETTINGS_STREAMMEDIA_SPX_AGC_GAINLEVEL, DEFAULT_SPEEXDSP_AGC_GAINLEVEL).toInt();
preprocessor.speexdsp.nMaxIncDBSec = ttSettings->value(SETTINGS_STREAMMEDIA_SPX_AGC_INC_MAXDB, DEFAULT_SPEEXDSP_AGC_INC_MAXDB).toInt();
Expand All @@ -354,7 +355,7 @@ AudioPreprocessor loadAudioPreprocessor(AudioPreprocessorType preprocessortype)
preprocessor.speexdsp.nEchoSuppress = DEFAULT_SPEEXDSP_ECHO_SUPPRESS;
preprocessor.speexdsp.nEchoSuppressActive = DEFAULT_SPEEXDSP_ECHO_SUPPRESSACTIVE;
break;
case TEAMTALK_AUDIOPREPROCESSOR:
case TEAMTALK_AUDIOPREPROCESSOR :
preprocessor.ttpreprocessor.bMuteLeftSpeaker = ttSettings->value(SETTINGS_STREAMMEDIA_TTAP_MUTELEFT, false).toBool();
preprocessor.ttpreprocessor.bMuteRightSpeaker = ttSettings->value(SETTINGS_STREAMMEDIA_TTAP_MUTERIGHT, false).toBool();
preprocessor.ttpreprocessor.nGainLevel = ttSettings->value(SETTINGS_STREAMMEDIA_TTAP_GAINLEVEL, SOUND_GAIN_DEFAULT).toInt();
Expand All @@ -363,8 +364,9 @@ AudioPreprocessor loadAudioPreprocessor(AudioPreprocessorType preprocessortype)
preprocessor.webrtc.gaincontroller2.bEnable = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_GAINCTL_ENABLE, DEFAULT_WEBRTC_GAINCTL_ENABLE).toBool();
preprocessor.webrtc.gaincontroller2.fixeddigital.fGainDB = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_GAINDB, DEFAULT_WEBRTC_GAINDB).toFloat();
preprocessor.webrtc.gaincontroller2.adaptivedigital.bEnable = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_SAT_PROT_ENABLE, DEFAULT_WEBRTC_SAT_PROT_ENABLE).toBool();
preprocessor.webrtc.gaincontroller2.adaptivedigital.fInitialSaturationMarginDB = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_INIT_SAT_MARGIN_DB, DEFAULT_WEBRTC_INIT_SAT_MARGIN_DB).toFloat();
preprocessor.webrtc.gaincontroller2.adaptivedigital.fExtraSaturationMarginDB = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_EXTRA_SAT_MARGIN_DB, DEFAULT_WEBRTC_EXTRA_SAT_MARGIN_DB).toFloat();
preprocessor.webrtc.gaincontroller2.adaptivedigital.fHeadRoomDB = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_HEADROOM_DB, DEFAULT_WEBRTC_HEADROOM_DB).toFloat();
preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxGainDB = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_MAXGAIN_DB, DEFAULT_WEBRTC_MAXGAIN_DB).toFloat();
preprocessor.webrtc.gaincontroller2.adaptivedigital.fInitialGainDB = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_INITGAIN_DB, DEFAULT_WEBRTC_INITIAL_GAIN_DB).toFloat();
preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxGainChangeDBPerSecond = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_MAXGAIN_DBSEC, DEFAULT_WEBRTC_MAXGAIN_DBSEC).toFloat();
preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxOutputNoiseLevelDBFS = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_MAX_OUT_NOISE, DEFAULT_WEBRTC_MAX_OUT_NOISE).toFloat();
preprocessor.webrtc.noisesuppression.bEnable = ttSettings->value(SETTINGS_STREAMMEDIA_WEBRTC_NOISESUPPRESS_ENABLE, DEFAULT_WEBRTC_NOISESUPPRESS_ENABLE).toBool();
Expand All @@ -380,9 +382,10 @@ void saveAudioPreprocessor(const AudioPreprocessor& preprocessor)
ttSettings->setValue(SETTINGS_STREAMMEDIA_AUDIOPREPROCESSOR, preprocessor.nPreprocessor);
switch (preprocessor.nPreprocessor)
{
case NO_AUDIOPREPROCESSOR:
case NO_AUDIOPREPROCESSOR :
case WEBRTC_AUDIOPREPROCESSOR_OBSOLETE_R4332 :
break;
case SPEEXDSP_AUDIOPREPROCESSOR:
case SPEEXDSP_AUDIOPREPROCESSOR :
ttSettings->setValue(SETTINGS_STREAMMEDIA_SPX_AGC_ENABLE, preprocessor.speexdsp.bEnableAGC);
ttSettings->setValue(SETTINGS_STREAMMEDIA_SPX_AGC_GAINLEVEL, preprocessor.speexdsp.nGainLevel);
ttSettings->setValue(SETTINGS_STREAMMEDIA_SPX_AGC_INC_MAXDB, preprocessor.speexdsp.nMaxIncDBSec);
Expand All @@ -391,7 +394,7 @@ void saveAudioPreprocessor(const AudioPreprocessor& preprocessor)
ttSettings->setValue(SETTINGS_STREAMMEDIA_SPX_DENOISE_ENABLE, preprocessor.speexdsp.bEnableDenoise);
ttSettings->setValue(SETTINGS_STREAMMEDIA_SPX_DENOISE_SUPPRESS, preprocessor.speexdsp.nMaxNoiseSuppressDB);
break;
case TEAMTALK_AUDIOPREPROCESSOR:
case TEAMTALK_AUDIOPREPROCESSOR :
ttSettings->setValue(SETTINGS_STREAMMEDIA_TTAP_MUTELEFT, preprocessor.ttpreprocessor.bMuteLeftSpeaker);
ttSettings->setValue(SETTINGS_STREAMMEDIA_TTAP_MUTERIGHT, preprocessor.ttpreprocessor.bMuteRightSpeaker);
ttSettings->setValue(SETTINGS_STREAMMEDIA_TTAP_GAINLEVEL, preprocessor.ttpreprocessor.nGainLevel);
Expand All @@ -400,8 +403,9 @@ void saveAudioPreprocessor(const AudioPreprocessor& preprocessor)
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_GAINCTL_ENABLE, preprocessor.webrtc.gaincontroller2.bEnable);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_GAINDB, preprocessor.webrtc.gaincontroller2.fixeddigital.fGainDB);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_SAT_PROT_ENABLE, preprocessor.webrtc.gaincontroller2.adaptivedigital.bEnable );
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_INIT_SAT_MARGIN_DB, preprocessor.webrtc.gaincontroller2.adaptivedigital.fInitialSaturationMarginDB);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_EXTRA_SAT_MARGIN_DB, preprocessor.webrtc.gaincontroller2.adaptivedigital.fExtraSaturationMarginDB);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_HEADROOM_DB, preprocessor.webrtc.gaincontroller2.adaptivedigital.fHeadRoomDB);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_MAXGAIN_DB, preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxGainDB);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_INITGAIN_DB, preprocessor.webrtc.gaincontroller2.adaptivedigital.fInitialGainDB);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_MAXGAIN_DBSEC, preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxGainChangeDBPerSecond);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_MAX_OUT_NOISE, preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxOutputNoiseLevelDBFS);
ttSettings->setValue(SETTINGS_STREAMMEDIA_WEBRTC_NOISESUPPRESS_ENABLE, preprocessor.webrtc.noisesuppression.bEnable);
Expand Down
11 changes: 6 additions & 5 deletions Client/qtTeamTalk/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,12 @@
#define SETTINGS_STREAMMEDIA_SPX_AGC_GAINMAXDB "stream-media/spxaudiopreprocessor/agc-gainmaxdb"
#define SETTINGS_STREAMMEDIA_SPX_DENOISE_ENABLE "stream-media/spxaudiopreprocessor/denoise-enable"
#define SETTINGS_STREAMMEDIA_SPX_DENOISE_SUPPRESS "stream-media/spxaudiopreprocessor/denoise-suppress"
#define SETTINGS_STREAMMEDIA_WEBRTC_GAINCTL_ENABLE "stream-media/webrtcaudiopreprocessor/gain-enable"
#define SETTINGS_STREAMMEDIA_WEBRTC_GAINDB "stream-media/webrtcaudiopreprocessor/gain-db"
#define SETTINGS_STREAMMEDIA_WEBRTC_SAT_PROT_ENABLE "stream-media/webrtcaudiopreprocessor/sat-protection-enable"
#define SETTINGS_STREAMMEDIA_WEBRTC_INIT_SAT_MARGIN_DB "stream-media/webrtcaudiopreprocessor/init-sat-margin-db"
#define SETTINGS_STREAMMEDIA_WEBRTC_EXTRA_SAT_MARGIN_DB "stream-media/webrtcaudiopreprocessor/extra-sat-margin-db"
#define SETTINGS_STREAMMEDIA_WEBRTC_GAINCTL_ENABLE "stream-media/webrtcaudiopreprocessor/gain-enable"
#define SETTINGS_STREAMMEDIA_WEBRTC_GAINDB "stream-media/webrtcaudiopreprocessor/gain-db"
#define SETTINGS_STREAMMEDIA_WEBRTC_SAT_PROT_ENABLE "stream-media/webrtcaudiopreprocessor/sat-protection-enable"
#define SETTINGS_STREAMMEDIA_WEBRTC_HEADROOM_DB "stream-media/webrtcaudiopreprocessor/headroom-db"
#define SETTINGS_STREAMMEDIA_WEBRTC_MAXGAIN_DB "stream-media/webrtcaudiopreprocessor/maxgain-db"
#define SETTINGS_STREAMMEDIA_WEBRTC_INITGAIN_DB "stream-media/webrtcaudiopreprocessor/initial-gain-db"
#define SETTINGS_STREAMMEDIA_WEBRTC_MAXGAIN_DBSEC "stream-media/webrtcaudiopreprocessor/maxgain-dbsec"
#define SETTINGS_STREAMMEDIA_WEBRTC_MAX_OUT_NOISE "stream-media/webrtcaudiopreprocessor/max-out-noise"
#define SETTINGS_STREAMMEDIA_WEBRTC_NOISESUPPRESS_ENABLE "stream-media/webrtcaudiopreprocessor/noise-suppress-enable"
Expand Down
7 changes: 5 additions & 2 deletions Client/qtTeamTalk/utiltt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ AudioPreprocessor initDefaultAudioPreprocessor(AudioPreprocessorType preprocesso
preprocessor.ttpreprocessor.bMuteLeftSpeaker = DEFAULT_TEAMTALK_MUTELEFT;
preprocessor.ttpreprocessor.bMuteRightSpeaker = DEFAULT_TEAMTALK_MUTERIGHT;
break;
case WEBRTC_AUDIOPREPROCESSOR_OBSOLETE_R4332 :
break;
case WEBRTC_AUDIOPREPROCESSOR :
preprocessor.webrtc.preamplifier.bEnable = DEFAULT_WEBRTC_PREAMPLIFIER_ENABLE;
preprocessor.webrtc.preamplifier.fFixedGainFactor = DEFAULT_WEBRTC_PREAMPLIFIER_GAINFACTOR;
Expand All @@ -208,8 +210,9 @@ AudioPreprocessor initDefaultAudioPreprocessor(AudioPreprocessorType preprocesso
preprocessor.webrtc.gaincontroller2.bEnable = DEFAULT_WEBRTC_GAINCTL_ENABLE;
preprocessor.webrtc.gaincontroller2.fixeddigital.fGainDB = DEFAULT_WEBRTC_GAINDB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.bEnable = DEFAULT_WEBRTC_SAT_PROT_ENABLE;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fInitialSaturationMarginDB = DEFAULT_WEBRTC_INIT_SAT_MARGIN_DB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fExtraSaturationMarginDB = DEFAULT_WEBRTC_EXTRA_SAT_MARGIN_DB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fHeadRoomDB = DEFAULT_WEBRTC_HEADROOM_DB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fInitialGainDB = DEFAULT_WEBRTC_INITIAL_GAIN_DB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxGainDB = DEFAULT_WEBRTC_MAXGAIN_DB;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxGainChangeDBPerSecond = DEFAULT_WEBRTC_MAXGAIN_DBSEC;
preprocessor.webrtc.gaincontroller2.adaptivedigital.fMaxOutputNoiseLevelDBFS = DEFAULT_WEBRTC_MAX_OUT_NOISE;
preprocessor.webrtc.noisesuppression.bEnable = DEFAULT_WEBRTC_NOISESUPPRESS_ENABLE;
Expand Down
15 changes: 10 additions & 5 deletions Client/qtTeamTalk/utiltt.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,18 @@ do { \
#define DEFAULT_WEBRTC_PREAMPLIFIER_GAINFACTOR 1.0f
#define DEFAULT_WEBRTC_VAD_ENABLE FALSE
#define DEFAULT_WEBRTC_LEVELESTIMATION_ENABLE FALSE
/* gain controller 2 */
#define DEFAULT_WEBRTC_GAINCTL_ENABLE DEFAULT_AGC_ENABLE
#define DEFAULT_WEBRTC_GAINDB 15
/* gain controller 2 - fixed digital */
#define DEFAULT_WEBRTC_GAINDB 0.0f
/* gain controller 2 - adaptive digital */
#define DEFAULT_WEBRTC_SAT_PROT_ENABLE TRUE
#define DEFAULT_WEBRTC_INIT_SAT_MARGIN_DB 20
#define DEFAULT_WEBRTC_EXTRA_SAT_MARGIN_DB 2
#define DEFAULT_WEBRTC_MAXGAIN_DBSEC 3
#define DEFAULT_WEBRTC_MAX_OUT_NOISE -50
#define DEFAULT_WEBRTC_HEADROOM_DB 5.0f
#define DEFAULT_WEBRTC_MAXGAIN_DB 50.0f
#define DEFAULT_WEBRTC_INITIAL_GAIN_DB 15.0f
#define DEFAULT_WEBRTC_MAXGAIN_DBSEC 6.0f
#define DEFAULT_WEBRTC_MAX_OUT_NOISE -50.0f
/* noise suppression */
#define DEFAULT_WEBRTC_NOISESUPPRESS_ENABLE DEFAULT_DENOISE_ENABLE
#define DEFAULT_WEBRTC_NOISESUPPRESS_LEVEL 2
#define DEFAULT_WEBRTC_ECHO_CANCEL_ENABLE FALSE /* requires duplex mode */
Expand Down
33 changes: 19 additions & 14 deletions Library/TeamTalk.NET/TeamTalk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1350,14 +1350,16 @@ public struct FixedDigital
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AdaptiveDigital
{
/* @brief Enable saturation protector where saturation
* margin is 2 dB. */
/* @brief Configuration for fine tuning gain level after echo
* cancellation and noise suppression. */
public bool bEnable;
/* Range: 0 <= x <= 100. Default: 20 dB */
public float fInitialSaturationMarginDB;
/* Range: 0 <= x <= 100. Default: 2 dB */
public float fExtraSaturationMarginDB;
/* Range: 0 < x < infinite. Default: 3 dB/sec */
/** @brief Range: 0 <= x < infinite. Default: 5 dB */
public float fHeadRoomDB;
/** @brief Range: 0 < x < infinite. Default: 50 dB */
public float fMaxGainDB;
/** @brief Range: 0 <= x < infinite. Default: 15 dB */
public float fInitialGainDB;
/* Range: 0 < x < infinite. Default: 6 dB/sec */
public float fMaxGainChangeDBPerSecond;
/* Range: -infinite < x < 0. Default: -50 */
public float fMaxOutputNoiseLevelDBFS;
Expand Down Expand Up @@ -1397,8 +1399,9 @@ public WebRTCAudioPreprocessor(bool set_defaults)
gaincontroller2.fixeddigital.fGainDB = WebRTCConstants.DEFAULT_WEBRTC_GAINDB;

gaincontroller2.adaptivedigital.bEnable = WebRTCConstants.DEFAULT_WEBRTC_SAT_PROT_ENABLE;
gaincontroller2.adaptivedigital.fInitialSaturationMarginDB = WebRTCConstants.DEFAULT_WEBRTC_INIT_SAT_MARGIN_DB;
gaincontroller2.adaptivedigital.fExtraSaturationMarginDB = WebRTCConstants.DEFAULT_WEBRTC_EXTRA_SAT_MARGIN_DB;
gaincontroller2.adaptivedigital.fHeadRoomDB = WebRTCConstants.DEFAULT_WEBRTC_HEADROOM_DB;
gaincontroller2.adaptivedigital.fMaxGainDB = WebRTCConstants.DEFAULT_WEBRTC_MAXGAIN_DB;
gaincontroller2.adaptivedigital.fInitialGainDB = WebRTCConstants.DEFAULT_WEBRTC_INITIAL_GAIN_DB;
gaincontroller2.adaptivedigital.fMaxGainChangeDBPerSecond = WebRTCConstants.DEFAULT_WEBRTC_MAXGAIN_DBSEC;
gaincontroller2.adaptivedigital.fMaxOutputNoiseLevelDBFS = WebRTCConstants.DEFAULT_WEBRTC_MAX_OUT_NOISE;

Expand All @@ -1420,8 +1423,9 @@ public WebRTCAudioPreprocessor(bool set_defaults)
gaincontroller2.fixeddigital.fGainDB = 0.0f;

gaincontroller2.adaptivedigital.bEnable = false;
gaincontroller2.adaptivedigital.fInitialSaturationMarginDB = 0.0f;
gaincontroller2.adaptivedigital.fExtraSaturationMarginDB = 0.0f;
gaincontroller2.adaptivedigital.fHeadRoomDB = 0.0f;
gaincontroller2.adaptivedigital.fMaxGainDB = 0.0f;
gaincontroller2.adaptivedigital.fInitialGainDB = 0.0f;
gaincontroller2.adaptivedigital.fMaxGainChangeDBPerSecond = 0.0f;
gaincontroller2.adaptivedigital.fMaxOutputNoiseLevelDBFS = 0.0f;

Expand All @@ -1440,9 +1444,10 @@ public struct WebRTCConstants
public const bool DEFAULT_WEBRTC_GAINCTL_ENABLE = false;
public const float DEFAULT_WEBRTC_GAINDB = 15;
public const bool DEFAULT_WEBRTC_SAT_PROT_ENABLE = false;
public const float DEFAULT_WEBRTC_INIT_SAT_MARGIN_DB = 20;
public const float DEFAULT_WEBRTC_EXTRA_SAT_MARGIN_DB = 2;
public const float DEFAULT_WEBRTC_MAXGAIN_DBSEC = 3;
public const float DEFAULT_WEBRTC_HEADROOM_DB = 5;
public const float DEFAULT_WEBRTC_MAXGAIN_DB = 50;
public const float DEFAULT_WEBRTC_INITIAL_GAIN_DB = 15;
public const float DEFAULT_WEBRTC_MAXGAIN_DBSEC = 6;
public const float DEFAULT_WEBRTC_MAX_OUT_NOISE = -50;
public const bool DEFAULT_WEBRTC_NOISESUPPRESS_ENABLE = false;
public const int DEFAULT_WEBRTC_NOISESUPPRESS_LEVEL = 2;
Expand Down
Loading

0 comments on commit 493b498

Please sign in to comment.