Skip to content

Commit

Permalink
common: Switch to updated rnnoise v0.2
Browse files Browse the repository at this point in the history
Credits to @pengzhendong for initial PR with rnnoise update.
  • Loading branch information
werman committed May 18, 2024
1 parent c0af5da commit 4c23556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ option(BUILD_LV2_PLUGIN "If the LV2 plugin should be built" ON)
option(BUILD_LADSPA_PLUGIN "If the LADSPA plugin should be built" ON)
option(BUILD_AU_PLUGIN "If the AU plugin should be built (macOS only)" ON)
option(BUILD_AUV3_PLUGIN "If the AUv3 plugin should be built (macOS only)" ON)
option(BUILD_RTCD "Enable x86 run-time CPU detection (x86 only)" OFF)

if (BUILD_TESTS)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external/catch2/)
endif ()

add_subdirectory(src/rnnoise)
add_subdirectory(external/rnnoise)
add_subdirectory(src/common)
if (BUILD_LADSPA_PLUGIN)
add_subdirectory(src/ladspa_plugin)
Expand Down
4 changes: 2 additions & 2 deletions src/common/src/RnNoiseCommonPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <algorithm>
#include <cassert>

#include <rnnoise/rnnoise.h>
#include <rnnoise.h>

static const uint32_t k_minVADGracePeriodBlocks = 20;
static const uint32_t k_maxRetroactiveVADGraceBlocks = 99;
Expand Down Expand Up @@ -267,7 +267,7 @@ void RnNoiseCommonPlugin::createDenoiseState() {
m_prevRetroactiveVADGraceBlocks = 0;

for (uint32_t i = 0; i < m_channelCount; i++) {
auto denoiseState = std::shared_ptr<DenoiseState>(rnnoise_create(), [](DenoiseState *st) {
auto denoiseState = std::shared_ptr<DenoiseState>(rnnoise_create(nullptr), [](DenoiseState *st) {
rnnoise_destroy(st);
});

Expand Down

0 comments on commit 4c23556

Please sign in to comment.