Skip to content

Commit 7f2f861

Browse files
committed
Add Opus DRED and OSCE AI audio effects
1 parent 986aed6 commit 7f2f861

52 files changed

Lines changed: 591 additions & 26 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ChangeLog.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44

55
Version 5.22.1, unreleased
66
Default Qt Client
7-
-
7+
- Option to enable AI packet loss recovery (DRED), making outgoing voice more resilient on unstable networks
8+
- Option to enable AI speech enhancement (OSCE) to improve clarity of received voice
89
Android Client
9-
-
10+
- Option to enable AI packet loss recovery (DRED), making outgoing voice more resilient on unstable networks
11+
- Option to enable AI speech enhancement (OSCE) to improve clarity of received voice
1012
iOS Client
11-
-
13+
- Option to enable AI packet loss recovery (DRED), making outgoing voice more resilient on unstable networks
14+
- Option to enable AI speech enhancement (OSCE) to improve clarity of received voice
15+
Accessible Windows Client
16+
- Option to enable AI packet loss recovery (DRED), making outgoing voice more resilient on unstable networks
17+
- Option to enable AI speech enhancement (OSCE) to improve clarity of received voice
1218
Server
1319
-
1420

Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
import javax.xml.xpath.XPathExpressionException;
7676
import javax.xml.xpath.XPathFactory;
7777

78+
import dk.bearware.AIAudioEffect;
7879
import dk.bearware.AudioPreprocessor;
7980
import dk.bearware.AudioPreprocessorType;
8081
import dk.bearware.Channel;
@@ -869,6 +870,12 @@ private void setupAudioPreprocessor() {
869870
int gain = prefs.getInt(Preferences.PREF_SOUNDSYSTEM_MICROPHONEGAIN, SoundLevel.SOUND_GAIN_DEFAULT);
870871
ttclient.setSoundInputGainLevel(gain);
871872
}
873+
874+
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
875+
AIAudioEffect aiEffect = new AIAudioEffect();
876+
aiEffect.bEnableDRED = prefs.getBoolean(Preferences.PREF_SOUNDSYSTEM_AI_DRED, false);
877+
aiEffect.bEnableOSCE = prefs.getBoolean(Preferences.PREF_SOUNDSYSTEM_AI_OSCE, false);
878+
ttclient.setAIAudioEffect(aiEffect);
872879
}
873880

874881
@Override

Client/TeamTalkAndroid/src/main/java/dk/bearware/data/Preferences.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public class Preferences {
4444
PREF_SOUNDSYSTEM_MUTE_ON_TRANSMISSION = "mute_speakers_on_tx_checkbox",
4545
PREF_SOUNDSYSTEM_SPEAKERPHONE = "speakerphone_checkbox",
4646
PREF_SOUNDSYSTEM_BLUETOOTH_HEADSET = "bluetooth_headset_checkbox",
47-
PREF_SOUNDSYSTEM_VOICEPROCESSING = "voiceprocessing_checkbox";
47+
PREF_SOUNDSYSTEM_VOICEPROCESSING = "voiceprocessing_checkbox",
48+
PREF_SOUNDSYSTEM_AI_DRED = "ai_dred_checkbox",
49+
PREF_SOUNDSYSTEM_AI_OSCE = "ai_osce_checkbox";
4850
public static final String
4951
PREF_JOIN_ROOT_CHAN = "auto_join_root_checkbox",
5052
PREF_SUB_TEXTMESSAGE = "sub_txtmsg_checkbox",

Client/TeamTalkAndroid/src/main/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@
163163
<string name="pref_summary_bluetooth_headset_checkbox">When bluetooth headset is connected use its microphone</string>
164164
<string name="pref_title_voice_processing_checkbox">Enable voice preprocessing</string>
165165
<string name="pref_summary_voice_processing_checkbox">Use echo cancellation and automatic gain control</string>
166+
<string name="pref_title_ai_dred_checkbox">Enable AI packet loss recovery (DRED)</string>
167+
<string name="pref_summary_ai_dred_checkbox">Make outgoing voice more resilient on unstable networks</string>
168+
<string name="pref_title_ai_osce_checkbox">Enable AI speech enhancement (OSCE)</string>
169+
<string name="pref_summary_ai_osce_checkbox">Improve clarity of received voice</string>
166170

167171
<string name="text_tts_loggedin">has logged in</string>
168172
<string name="text_tts_loggedout">has logged out</string>

Client/TeamTalkAndroid/src/main/res/xml/pref_soundsystem.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@
1919
android:title="@string/pref_title_voice_processing_checkbox"
2020
android:summary="@string/pref_summary_voice_processing_checkbox" />
2121

22+
<CheckBoxPreference
23+
android:key="ai_dred_checkbox"
24+
android:defaultValue="false"
25+
android:title="@string/pref_title_ai_dred_checkbox"
26+
android:summary="@string/pref_summary_ai_dred_checkbox" />
27+
28+
<CheckBoxPreference
29+
android:key="ai_osce_checkbox"
30+
android:defaultValue="false"
31+
android:title="@string/pref_title_ai_osce_checkbox"
32+
android:summary="@string/pref_summary_ai_osce_checkbox" />
33+
2234
<CheckBoxPreference
2335
android:key="bluetooth_headset_checkbox"
2436
android:defaultValue="false"

Client/TeamTalkClassic/Helper.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,11 @@ BOOL InitSoundSystem(teamtalk::ClientXML& xmlSettings, SoundDevice& indev, Sound
607607
effects.bEnableEchoCancellation = bEchoCancel;
608608
TT_SetSoundDeviceEffects(ttInst, &effects);
609609

610+
AIAudioEffect aiEffect = {};
611+
aiEffect.bEnableDRED = xmlSettings.GetAIAudioDRED(DEFAULT_AI_DRED_ENABLE);
612+
aiEffect.bEnableOSCE = xmlSettings.GetAIAudioOSCE(DEFAULT_AI_OSCE_ENABLE);
613+
TT_SetAIAudioEffect(ttInst, &aiEffect);
614+
610615
BOOL bSuccess = FALSE;
611616

612617
if (bDuplex || (effects.bEnableEchoCancellation && (indev.nSoundSystem == SOUNDSYSTEM_WASAPI)))
@@ -644,8 +649,8 @@ extern BOOL g_bSpeech;
644649

645650
void AddTextToSpeechMessage(const CString& szMsg)
646651
{
647-
#if defined(ENABLE_TOLK)
648-
if(g_bSpeech)
649-
Tolk_Output(szMsg);
652+
#if defined(ENABLE_TOLK)
653+
if(g_bSpeech)
654+
Tolk_Output(szMsg);
650655
#endif
651656
}

Client/TeamTalkClassic/TeamTalk.rc

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ BEGIN
247247
CONTROL "",IDC_SLIDER_CLIENTSOUNDS_VOL,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP | 0x400,148,211,99,15
248248
END
249249

250-
IDD_PROPPAGE_SOUNDSYSPAGE DIALOGEX 0, 0, 260, 221
250+
IDD_PROPPAGE_SOUNDSYSPAGE DIALOGEX 0, 0, 260, 249
251251
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
252252
CAPTION "Sound System"
253253
FONT 8, "MS Sans Serif", 0, 0, 0x0
254254
BEGIN
255-
GROUPBOX "Sound system settings",IDC_STATIC_GRPSOUNDSYSTEM,7,7,246,207
255+
GROUPBOX "Sound system settings",IDC_STATIC_GRPSOUNDSYSTEM,7,7,246,235
256256
CONTROL "Windows Audio Session",IDC_RADIO_WASAPI,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,41,22,95,10
257257
CONTROL "DirectSound",IDC_RADIO_DIRECTSOUND,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,160,22,56,10
258258
LTEXT "Input device",IDC_STATIC_INPUT,14,39,75,8
@@ -270,12 +270,16 @@ BEGIN
270270
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,136,236,10
271271
CONTROL "Enable noise reduction (suppress noise from microphone)",IDC_CHECK_DENOISE,
272272
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,150,236,10
273-
CONTROL "Auto position users using 3D sound",IDC_CHECK_POSITIONING,
273+
CONTROL "Enable AI packet loss recovery (DRED)",IDC_CHECK_AI_DRED,
274274
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,164,236,10
275-
LTEXT "Media file vs. voice volume",IDC_STATIC_MEDIASTREAMVOL,12,180,104,8
276-
CONTROL "",IDC_SLIDER_MEDIASTREAM_VOL,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP | 0x400,117,176,131,15
277-
PUSHBUTTON "Refresh devices",IDC_BUTTON_REFRESHSND,132,193,60,12
278-
PUSHBUTTON "&Default",IDC_BUTTON_DEFAULT,197,193,51,12
275+
CONTROL "Enable AI speech enhancement (OSCE)",IDC_CHECK_AI_OSCE,
276+
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,178,236,10
277+
CONTROL "Auto position users using 3D sound",IDC_CHECK_POSITIONING,
278+
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,192,236,10
279+
LTEXT "Media file vs. voice volume",IDC_STATIC_MEDIASTREAMVOL,12,208,104,8
280+
CONTROL "",IDC_SLIDER_MEDIASTREAM_VOL,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP | 0x400,117,204,131,15
281+
PUSHBUTTON "Refresh devices",IDC_BUTTON_REFRESHSND,132,221,60,12
282+
PUSHBUTTON "&Default",IDC_BUTTON_DEFAULT,197,221,51,12
279283
END
280284

281285
IDD_PROPPAGE_WINDOWPAGE DIALOGEX 0, 0, 260, 240
@@ -1083,7 +1087,7 @@ BEGIN
10831087
RIGHTMARGIN, 253
10841088
VERTGUIDE, 248
10851089
TOPMARGIN, 7
1086-
BOTTOMMARGIN, 214
1090+
BOTTOMMARGIN, 242
10871091
END
10881092

10891093
IDD_PROPPAGE_WINDOWPAGE, DIALOG
@@ -1540,8 +1544,8 @@ IDR_MAINFRAME ICON "res\\TeamTalk.ico"
15401544
//
15411545

15421546
VS_VERSION_INFO VERSIONINFO
1543-
FILEVERSION 5,22,1,5199
1544-
PRODUCTVERSION 5,22,1,5199
1547+
FILEVERSION 5,22,1,5199
1548+
PRODUCTVERSION 5,22,1,5199
15451549
FILEFLAGSMASK 0x1fL
15461550
#ifdef _DEBUG
15471551
FILEFLAGS 0x1L
@@ -1558,12 +1562,12 @@ BEGIN
15581562
BEGIN
15591563
VALUE "CompanyName", "BearWare.dk"
15601564
VALUE "FileDescription", "TeamTalk voice conferencing client"
1561-
VALUE "FileVersion", "5, 22, 1, 5199"
1565+
VALUE "FileVersion", "5, 22, 1, 5199"
15621566
VALUE "InternalName", "TeamTalk5.exe"
15631567
VALUE "LegalCopyright", "Copyright (c) 2005-2020, BearWare.dk. All rights reserved."
15641568
VALUE "OriginalFilename", "TeamTalk5.exe"
15651569
VALUE "ProductName", "BearWare.dk TeamTalk"
1566-
VALUE "ProductVersion", "5, 22, 1, 5199"
1570+
VALUE "ProductVersion", "5, 22, 1, 5199"
15671571
END
15681572
END
15691573
BLOCK "VarFileInfo"

Client/TeamTalkClassic/TeamTalkBase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ AudioPreprocessor InitDefaultAudioPreprocessor(AudioPreprocessorType preprocesso
9595
#define DEFAULT_ECHO_ENABLE FALSE
9696
#define DEFAULT_AGC_ENABLE FALSE
9797
#define DEFAULT_DENOISE_ENABLE FALSE
98+
#define DEFAULT_AI_DRED_ENABLE FALSE
99+
#define DEFAULT_AI_OSCE_ENABLE FALSE
98100

99101
#define DEFAULT_SPEEXDSP_AGC_ENABLE DEFAULT_AGC_ENABLE
100102
#define DEFAULT_SPEEXDSP_AGC_GAINLEVEL 8000

Client/TeamTalkClassic/TeamTalkDlg.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,8 @@ void CTeamTalkDlg::OnFilePreferences()
34873487
soundpage.m_bEchoCancel = m_xmlSettings.GetEchoCancel(DEFAULT_ECHO_ENABLE);
34883488
soundpage.m_bAGC = m_xmlSettings.GetAGC(DEFAULT_AGC_ENABLE);
34893489
soundpage.m_bDenoise = m_xmlSettings.GetDenoise(DEFAULT_DENOISE_ENABLE);
3490+
soundpage.m_bAIDRED = m_xmlSettings.GetAIAudioDRED(DEFAULT_AI_DRED_ENABLE);
3491+
soundpage.m_bAIOSCE = m_xmlSettings.GetAIAudioOSCE(DEFAULT_AI_OSCE_ENABLE);
34903492
soundpage.m_nMediaVsVoice = m_xmlSettings.GetMediaStreamVsVoice(DEFAULT_MEDIA_VS_VOICE);
34913493

34923494
///////////////////////
@@ -3741,6 +3743,8 @@ void CTeamTalkDlg::OnFilePreferences()
37413743
bRestartSound |= m_xmlSettings.GetAGC(DEFAULT_AGC_ENABLE) != bool(soundpage.m_bAGC);
37423744
bRestartSound |= m_xmlSettings.GetEchoCancel(DEFAULT_ECHO_ENABLE) != bool(soundpage.m_bEchoCancel);
37433745
bRestartSound |= m_xmlSettings.GetDenoise(DEFAULT_DENOISE_ENABLE) != bool(soundpage.m_bDenoise);
3746+
bRestartSound |= m_xmlSettings.GetAIAudioDRED(DEFAULT_AI_DRED_ENABLE) != bool(soundpage.m_bAIDRED);
3747+
bRestartSound |= m_xmlSettings.GetAIAudioOSCE(DEFAULT_AI_OSCE_ENABLE) != bool(soundpage.m_bAIOSCE);
37443748

37453749
m_xmlSettings.SetSoundOutputDevice(soundpage.m_nOutputDevice);
37463750
m_xmlSettings.SetSoundOutputDevice(STR_UTF8(soundpage.m_szOutputDeviceID));
@@ -3750,6 +3754,8 @@ void CTeamTalkDlg::OnFilePreferences()
37503754
m_xmlSettings.SetEchoCancel(soundpage.m_bEchoCancel);
37513755
m_xmlSettings.SetAGC(soundpage.m_bAGC);
37523756
m_xmlSettings.SetDenoise(soundpage.m_bDenoise);
3757+
m_xmlSettings.SetAIAudioDRED(soundpage.m_bAIDRED);
3758+
m_xmlSettings.SetAIAudioOSCE(soundpage.m_bAIOSCE);
37533759
if(m_xmlSettings.GetMediaStreamVsVoice(DEFAULT_MEDIA_VS_VOICE) != soundpage.m_nMediaVsVoice)
37543760
{
37553761
m_xmlSettings.SetMediaStreamVsVoice(soundpage.m_nMediaVsVoice);

Client/TeamTalkClassic/gui/SoundSysPage.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ CSoundSysPage::CSoundSysPage()
4747
, m_bTesting(FALSE)
4848
, m_bDenoise(FALSE)
4949
, m_bEchoCancel(DEFAULT_ECHO_ENABLE)
50+
, m_bAIDRED(DEFAULT_AI_DRED_ENABLE)
51+
, m_bAIOSCE(DEFAULT_AI_OSCE_ENABLE)
5052
, m_SndLoopBack(NULL)
5153
, m_bAGC(DEFAULT_AGC_ENABLE)
5254
, m_nMediaVsVoice(DEFAULT_MEDIA_VS_VOICE)
@@ -75,6 +77,10 @@ void CSoundSysPage::DoDataExchange(CDataExchange* pDX)
7577
DDX_Control(pDX, IDC_BUTTON_DEFAULT, m_wndDefaultBtn);
7678
DDX_Control(pDX, IDC_CHECK_ECHOCANCEL, m_btnEchoCancel);
7779
DDX_Check(pDX, IDC_CHECK_ECHOCANCEL, m_bEchoCancel);
80+
DDX_Control(pDX, IDC_CHECK_AI_DRED, m_btnAIDRED);
81+
DDX_Check(pDX, IDC_CHECK_AI_DRED, m_bAIDRED);
82+
DDX_Control(pDX, IDC_CHECK_AI_OSCE, m_btnAIOSCE);
83+
DDX_Check(pDX, IDC_CHECK_AI_OSCE, m_bAIOSCE);
7884
DDX_Control(pDX, IDC_STATIC_INPUT_SAMPLERATES, m_wndInputSampleRates);
7985
DDX_Control(pDX, IDC_STATIC_OUTPUT_SAMPLERATES, m_wndOutputSampleRates);
8086
DDX_Check(pDX, IDC_CHECK_AGC, m_bAGC);

0 commit comments

Comments
 (0)