-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT(client): Restore RNNoise for version 0.2 #6607
Open
guillermofbriceno
wants to merge
1
commit into
mumble-voip:master
Choose a base branch
from
guillermofbriceno:rnn2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+306
−69
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule renamenoise
deleted from
2a551a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Copyright 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>. | ||
|
||
include(FetchContent) | ||
|
||
set(RNNOISE_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../rnnoise-src") | ||
set(RNNOISE_MODEL_URL "https://media.xiph.org/rnnoise/models/rnnoise_data-") | ||
|
||
if(NOT EXISTS "${RNNOISE_SRC_DIR}/COPYING") | ||
message(FATAL_ERROR | ||
"${RNNOISE_SRC_DIR} was not found.\n" | ||
"Please checkout the submodule:\n" | ||
"git submodule update --init --recursive" | ||
) | ||
endif() | ||
|
||
if(WIN32) | ||
add_library(rnnoise SHARED) | ||
set_target_properties(rnnoise PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
if(MINGW) | ||
# Remove "lib" prefix. | ||
set_target_properties(rnnoise PROPERTIES PREFIX "") | ||
endif() | ||
target_compile_definitions(rnnoise | ||
PRIVATE | ||
"WIN32" | ||
"DLL_EXPORT" | ||
) | ||
else() | ||
add_library(rnnoise STATIC) | ||
endif() | ||
|
||
target_compile_definitions(rnnoise PRIVATE "HAVE_CONFIG_H") | ||
|
||
target_include_directories(rnnoise | ||
PRIVATE SYSTEM | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
PUBLIC SYSTEM | ||
"${RNNOISE_SRC_DIR}/include" | ||
"${RNNOISE_SRC_DIR}/src" | ||
) | ||
|
||
file(READ "${RNNOISE_SRC_DIR}/model_version" rnnoise_model_hash) | ||
string(STRIP ${rnnoise_model_hash} rnnoise_model_hash) | ||
string(CONCAT rnnoise_model_url "${RNNOISE_MODEL_URL}" "${rnnoise_model_hash}" ".tar.gz") | ||
|
||
FetchContent_Declare( | ||
rnnoise_model | ||
URL "${rnnoise_model_url}" | ||
URL_HASH SHA256=${rnnoise_model_hash} | ||
DOWNLOAD_EXTRACT_TIMESTAMP 1 | ||
) | ||
|
||
FetchContent_MakeAvailable(rnnoise_model) | ||
|
||
add_custom_command( | ||
OUTPUT | ||
"${RNNOISE_SRC_DIR}/src/rnnoise_data.c" | ||
"${RNNOISE_SRC_DIR}/src/rnnoise_data.h" | ||
"${RNNOISE_SRC_DIR}/src/rnnoise_data_little.c" | ||
"${RNNOISE_SRC_DIR}/src/rnnoise_data_little.h" | ||
|
||
WORKING_DIRECTORY "${RNNOISE_SRC_DIR}" | ||
COMMAND "${CMAKE_COMMAND}" -E copy | ||
"${rnnoise_model_SOURCE_DIR}/src/rnnoise_data.c" | ||
"${rnnoise_model_SOURCE_DIR}/src/rnnoise_data.h" | ||
"${rnnoise_model_SOURCE_DIR}/src/rnnoise_data_little.c" | ||
"${rnnoise_model_SOURCE_DIR}/src/rnnoise_data_little.h" | ||
"${RNNOISE_SRC_DIR}/src" | ||
COMMENT "Downloading RNNoise model files" | ||
) | ||
|
||
target_sources(rnnoise PRIVATE | ||
"${RNNOISE_SRC_DIR}/src/rnnoise_data.c" | ||
"${RNNOISE_SRC_DIR}/src/rnnoise_tables.c" | ||
"${RNNOISE_SRC_DIR}/src/rnn.c" | ||
"${RNNOISE_SRC_DIR}/src/pitch.c" | ||
"${RNNOISE_SRC_DIR}/src/nnet.c" | ||
"${RNNOISE_SRC_DIR}/src/nnet_default.c" | ||
"${RNNOISE_SRC_DIR}/src/parse_lpcnet_weights.c" | ||
"${RNNOISE_SRC_DIR}/src/kiss_fft.c" | ||
"${RNNOISE_SRC_DIR}/src/denoise.c" | ||
"${RNNOISE_SRC_DIR}/src/celt_lpc.c" | ||
) | ||
|
||
target_disable_warnings(rnnoise) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/* config.h. Generated from config.h.in by configure. */ | ||
/* config.h.in. Generated from configure.ac by autoheader. */ | ||
|
||
/* Define to 1 if you have the <dlfcn.h> header file. */ | ||
#define HAVE_DLFCN_H 1 | ||
|
||
/* Define to 1 if you have the <inttypes.h> header file. */ | ||
#define HAVE_INTTYPES_H 1 | ||
|
||
/* Define to 1 if you have the <memory.h> header file. */ | ||
#define HAVE_MEMORY_H 1 | ||
|
||
/* Define to 1 if you have the <stdint.h> header file. */ | ||
#define HAVE_STDINT_H 1 | ||
|
||
/* Define to 1 if you have the <stdlib.h> header file. */ | ||
#define HAVE_STDLIB_H 1 | ||
|
||
/* Define to 1 if you have the <strings.h> header file. */ | ||
#define HAVE_STRINGS_H 1 | ||
|
||
/* Define to 1 if you have the <string.h> header file. */ | ||
#define HAVE_STRING_H 1 | ||
|
||
/* Define to 1 if you have the <sys/stat.h> header file. */ | ||
#define HAVE_SYS_STAT_H 1 | ||
|
||
/* Define to 1 if you have the <sys/types.h> header file. */ | ||
#define HAVE_SYS_TYPES_H 1 | ||
|
||
/* Define to 1 if you have the <unistd.h> header file. */ | ||
#define HAVE_UNISTD_H 1 | ||
|
||
/* 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 "rnnoise" | ||
|
||
/* Define to the full name and version of this package. */ | ||
#define PACKAGE_STRING "rnnoise unknown" | ||
|
||
/* Define to the one symbol short name of this package. */ | ||
#define PACKAGE_TARNAME "rnnoise" | ||
|
||
/* 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 RNNOISE_BUILD /**/ | ||
|
||
/* Define to 1 if you have the ANSI C header files. */ | ||
#define STDC_HEADERS 1 | ||
|
||
/* 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 | ||
|
||
/* Enable extensions on AIX 3, Interix. */ | ||
#ifndef _ALL_SOURCE | ||
# define _ALL_SOURCE 1 | ||
#endif | ||
/* Enable GNU extensions on systems that have them. */ | ||
#ifndef _GNU_SOURCE | ||
# define _GNU_SOURCE 1 | ||
#endif | ||
/* Enable threading extensions on Solaris. */ | ||
#ifndef _POSIX_PTHREAD_SEMANTICS | ||
# define _POSIX_PTHREAD_SEMANTICS 1 | ||
#endif | ||
/* Enable extensions on HP NonStop. */ | ||
#ifndef _TANDEM_SOURCE | ||
# define _TANDEM_SOURCE 1 | ||
#endif | ||
/* Enable general extensions on Solaris. */ | ||
#ifndef __EXTENSIONS__ | ||
# define __EXTENSIONS__ 1 | ||
#endif | ||
|
||
|
||
/* Enable large inode numbers on Mac OS X 10.5. */ | ||
#ifndef _DARWIN_USE_64_BIT_INODE | ||
# define _DARWIN_USE_64_BIT_INODE 1 | ||
#endif | ||
|
||
/* Number of bits in a file offset, on hosts where this is settable. */ | ||
/* #undef _FILE_OFFSET_BITS */ | ||
|
||
/* Define for large files, on AIX-style hosts. */ | ||
/* #undef _LARGE_FILES */ | ||
|
||
/* Define to 1 if on MINIX. */ | ||
/* #undef _MINIX */ | ||
|
||
/* Define to 2 if the system does not provide POSIX.1 features except with | ||
this defined. */ | ||
/* #undef _POSIX_1_SOURCE */ | ||
|
||
/* Define to 1 if you need to in order for `stat' and other things to work. */ | ||
/* #undef _POSIX_SOURCE */ | ||
|
||
/* 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 |
Submodule rnnoise-src
added at
d98345
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dislike the fact that we download the model from a random webserver at compile-time. My build process will not be affected but I strongly suspect this will most likely break the build process for some package maintainers on certain distros.
However, I have no immediate idea how to solve this. If this is not addressed before the merge, I advice downstream package maintainers (who have a problem with this) to just ship Mumble with ReNameNoise.