Skip to content

Commit

Permalink
FEAT(client): Add ReNameNoise as a replacement for RNNoise
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartmnt committed Mar 19, 2024
1 parent 23f7650 commit 8fa739e
Show file tree
Hide file tree
Showing 17 changed files with 164 additions and 263 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
[submodule "3rdparty/speexdsp"]
path = 3rdparty/speexdsp
url = https://github.com/xiph/speexdsp.git
[submodule "3rdparty/rnnoise-src"]
path = 3rdparty/rnnoise-src
url = https://github.com/mumble-voip/rnnoise.git
[submodule "3rdparty/FindPythonInterpreter"]
path = 3rdparty/FindPythonInterpreter
url = https://github.com/Krzmbrzl/FindPythonInterpreter.git
Expand All @@ -28,3 +25,6 @@
[submodule "3rdparty/cmake-compiler-flags"]
path = 3rdparty/cmake-compiler-flags
url = https://github.com/Krzmbrzl/cmake-compiler-flags.git
[submodule "3rdparty/renamenoise-src"]
path = 3rdparty/renamenoise-src
url = https://gitlab.com/Hartmnt/renamenoise
50 changes: 50 additions & 0 deletions 3rdparty/renamenoise-build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2005-2019 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.

set(RENAMENOISE_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../renamenoise-src")

if(NOT EXISTS "${RENAMENOISE_SRC_DIR}/COPYING")
message(FATAL_ERROR
"${RENAMENOISE_SRC_DIR} was not found.\n"
"Please checkout the submodule:\n"
"git submodule update --init --recursive"
)
endif()

if(WIN32)
add_library(renamenoise SHARED)
set_target_properties(renamenoise PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
if(MINGW)
# Remove "lib" prefix.
set_target_properties(renamenoise PROPERTIES PREFIX "")
endif()
target_compile_definitions(renamenoise
PRIVATE
"WIN32"
"DLL_EXPORT"
)
else()
add_library(renamenoise STATIC)
endif()

target_compile_definitions(renamenoise PRIVATE "HAVE_CONFIG_H")

target_include_directories(renamenoise
PRIVATE SYSTEM
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC SYSTEM
"${RENAMENOISE_SRC_DIR}/include"
)

target_sources(renamenoise PRIVATE
"${RENAMENOISE_SRC_DIR}/src/rnn_data.c"
"${RENAMENOISE_SRC_DIR}/src/rnn.c"
"${RENAMENOISE_SRC_DIR}/src/pitch.c"
"${RENAMENOISE_SRC_DIR}/src/renamenoise_fft.c"
"${RENAMENOISE_SRC_DIR}/src/denoise.c"
"${RENAMENOISE_SRC_DIR}/src/renamenoise_lpc.c"
)

target_disable_warnings(renamenoise)
46 changes: 46 additions & 0 deletions 3rdparty/renamenoise-build/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */

/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"

/* Enable assertions in code */
/* #undef OP_ENABLE_ASSERTIONS */

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "[email protected]"

/* Define to the full name of this package. */
#define PACKAGE_NAME "renamenoise"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "renamenoise unknown"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "renamenoise"

/* Define to the home page for this package. */
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "unknown"

/* This is a build of the library */
#define RENAMENOISE_BUILD /**/

/* Define this if the compiler supports __attribute__((
ifelse([visibility("default")], , [visibility_default],
[visibility("default")]) )) */
#define SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT 1

/* Define this if the compiler supports the -fvisibility flag */
#define SUPPORT_FLAG_VISIBILITY 1

/* We need at least WindowsXP for getaddrinfo/freeaddrinfo */
/* #undef _WIN32_WINNT */

/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
1 change: 1 addition & 0 deletions 3rdparty/renamenoise-src
Submodule renamenoise-src added at 08248d
57 changes: 0 additions & 57 deletions 3rdparty/rnnoise-build/CMakeLists.txt

This file was deleted.

122 changes: 0 additions & 122 deletions 3rdparty/rnnoise-build/config.h

This file was deleted.

1 change: 0 additions & 1 deletion 3rdparty/rnnoise-src
Submodule rnnoise-src deleted from a9afcc
12 changes: 6 additions & 6 deletions docs/dev/build-instructions/cmake_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Use the bundled GSL version instead of looking for one on the system
Build the included version of nlohmann_json instead of looking for one on the system
(Default: ON)

### bundled-rnnoise
### bundled-renamenoise

Build the included version of RNNoise instead of looking for one on the system.
(Default: ${rnnoise})
Build the included version of ReNameNoise instead of looking for one on the system.
(Default: ${renamenoise})

### bundled-speex

Expand Down Expand Up @@ -194,10 +194,10 @@ Use Qt's text-to-speech system (part of the Qt Speech module) instead of Mumble'
Build redacted (outdated) plugins as well
(Default: OFF)

### rnnoise
### renamenoise

Use RNNoise for machine learning noise reduction.
(Default: OFF)
Use ReNameNoise for machine learning noise reduction.
(Default: ON)

### server

Expand Down
15 changes: 2 additions & 13 deletions installer/ClientInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
public struct Features {
public bool overlay;
public bool g15;
public bool rnnoise;
}

public class ClientInstaller : MumbleInstall {
Expand Down Expand Up @@ -87,14 +86,11 @@ public ClientInstaller(string version, string arch, Features features) {
// 64 bit
this.Platform = WixSharp.Platform.x64;
binaries = new List<string>() {
"renamenoise.dll",
"speexdsp.dll",
"mumble.exe",
};

if (features.rnnoise) {
binaries.Add("rnnoise.dll");
}

if (features.overlay) {
binaries.Add("mumble_ol.dll");
binaries.Add("mumble_ol_helper.exe");
Expand All @@ -109,14 +105,11 @@ public ClientInstaller(string version, string arch, Features features) {
// 32 bit
this.Platform = WixSharp.Platform.x86;
binaries = new List<string>() {
"renamenoise.dll",
"speexdsp.dll",
"mumble.exe",
};

if (features.rnnoise) {
binaries.Add("rnnoise.dll");
}

if (features.overlay) {
binaries.Add("mumble_ol.dll");
binaries.Add("mumble_ol_helper.exe");
Expand Down Expand Up @@ -221,10 +214,6 @@ public static void Main(string[] args) {
if (args[i] == "--overlay") {
features.overlay = true;
}

if (args[i] == "--rnnoise") {
features.rnnoise = true;
}
}

if (version != null && arch != null) {
Expand Down
Loading

0 comments on commit 8fa739e

Please sign in to comment.