-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LADSPA support, add instructions for linux, fix compilation on li…
…nux. - Add LADSPA support to load plugin into pulseaudio. - Add instructions for working with pulseaudio. - Fix compilation on linux. - Updated readme.
- Loading branch information
Showing
17 changed files
with
1,813 additions
and
23 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
cmake_minimum_required(VERSION 3.6) | ||
project(rnnoise_ladspa_plugin LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
set(PROJECT_ROOT ../../../) | ||
|
||
set(LADSPA_INTERFACE_SRC | ||
ladspa.h | ||
ladspa++.h) | ||
|
||
set(LADSPA_IMPL_SRC | ||
RnNoiseLadspaPlugin.h | ||
RnNoiseLadspaPlugin.cpp) | ||
|
||
set(LADSPA_PLUGIN_SOURCES | ||
${LADSPA_INTERFACE_SRC} | ||
${LADSPA_IMPL_SRC}) | ||
|
||
function(build bit) | ||
set(LADSPA_TARGET_X${bit} rnnoise_ladspa_x${bit}) | ||
|
||
add_library(${LADSPA_TARGET_X${bit}} SHARED ${LADSPA_PLUGIN_SOURCES}) | ||
|
||
target_link_libraries(${LADSPA_TARGET_X${bit}} RnNoisePluginCommon "-static-libgcc -static-libstdc++ -m${bit}") | ||
|
||
set(X${bit}_COMPILE_OPTIONS | ||
"-m${bit};" | ||
"$<$<CONFIG:RELEASE>:-O3;>") | ||
|
||
target_compile_options(${LADSPA_TARGET_X${bit}} PRIVATE ${X${bit}_COMPILE_OPTIONS}) | ||
|
||
set_target_properties(${LADSPA_TARGET_X${bit}} PROPERTIES | ||
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/x${bit}/ladspa") | ||
endfunction() | ||
|
||
build(32) | ||
build(64) |
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,2 @@ | ||
#include "RnNoiseLadspaPlugin.h" | ||
|
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,65 @@ | ||
#pragma once | ||
|
||
#include "ladspa++.h" | ||
#include "common/RnNoiseCommonPlugin.h" | ||
|
||
using namespace ladspa; | ||
|
||
struct RnNoise { | ||
enum class port_names { | ||
in_1, | ||
out_1, | ||
size | ||
}; | ||
|
||
static constexpr port_info_t port_info[] = | ||
{ | ||
port_info_common::audio_input, | ||
port_info_common::audio_output, | ||
port_info_common::final_port | ||
}; | ||
|
||
static constexpr info_t info = | ||
{ | ||
9354877, // unique id | ||
"noise_suppressor", | ||
properties::realtime, | ||
"Noise Suppressor for Voice", | ||
"werman", | ||
"Removes wide range of noises from voice in real time, based on Xiph's RNNoise library.", | ||
{"voice", "noise suppression", "de-noise"}, | ||
strings::copyright::gpl3, | ||
nullptr // implementation data | ||
}; | ||
|
||
RnNoise() { | ||
m_rnNoisePlugin.init(); | ||
} | ||
|
||
~RnNoise() { | ||
m_rnNoisePlugin.deinit(); | ||
} | ||
|
||
void run(port_array_t<port_names, port_info> &ports) { | ||
|
||
const_buffer in_buffer = ports.get<port_names::in_1>(); | ||
buffer out_buffer = ports.get<port_names::out_1>(); | ||
|
||
m_rnNoisePlugin.process(in_buffer.data(), out_buffer.data(), in_buffer.size()); | ||
} | ||
|
||
RnNoiseCommonPlugin m_rnNoisePlugin; | ||
}; | ||
|
||
/* | ||
* to be called by ladspa | ||
*/ | ||
|
||
void _init() {} | ||
|
||
void _fini() {} | ||
|
||
const LADSPA_Descriptor * | ||
ladspa_descriptor(plugin_index_t index) { | ||
return collection<RnNoise>::get_ladspa_descriptor(index); | ||
} |
Oops, something went wrong.