From 37ae375fcaf980fe3381bbbb575c7809f65fac0d Mon Sep 17 00:00:00 2001 From: lawl Date: Sun, 5 Jul 2020 20:38:15 +0200 Subject: [PATCH] Add rnnoise_ladspa as a git submodule and build automatically --- .gitmodules | 3 +++ Makefile | 8 ++++++-- librnnoise_ladspa | 1 + librnnoise_ladspa/.gitignore | 1 - librnnoise_ladspa/README | 10 ---------- scripts/embedlibrnnoise.go | 5 +---- 6 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 .gitmodules create mode 160000 librnnoise_ladspa delete mode 100644 librnnoise_ladspa/.gitignore delete mode 100644 librnnoise_ladspa/README diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..83c1567 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "librnnoise_ladspa"] + path = librnnoise_ladspa + url = https://github.com/werman/noise-suppression-for-voice diff --git a/Makefile b/Makefile index 0cc3297..c32b9ae 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,13 @@ -dev: +dev: rnnoise go generate go build -release: +release: rnnoise go generate CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-s -w -extldflags "-static"' . upx noisetorch tar cvzf NoiseTorch_x64.tgz noisetorch rm noisetorch +rnnoise: + cd librnnoise_ladspa/; \ + cmake . -DBUILD_VST_PLUGIN=OFF -DBUILD_LV2_PLUGIN=OFF -DBUILD_LADSPA_PLUGIN=ON; \ + make diff --git a/librnnoise_ladspa b/librnnoise_ladspa new file mode 160000 index 0000000..453a8af --- /dev/null +++ b/librnnoise_ladspa @@ -0,0 +1 @@ +Subproject commit 453a8af82a31a5361f6a13bf95c97686f0a2acd1 diff --git a/librnnoise_ladspa/.gitignore b/librnnoise_ladspa/.gitignore deleted file mode 100644 index 72e8ffc..0000000 --- a/librnnoise_ladspa/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/librnnoise_ladspa/README b/librnnoise_ladspa/README deleted file mode 100644 index 0ee5686..0000000 --- a/librnnoise_ladspa/README +++ /dev/null @@ -1,10 +0,0 @@ -Put a compiled librnnoise_ladspa.so in this folder, it will be required for compilation. - -You can find the code for this here: https://github.com/werman/noise-suppression-for-voice - -Run: - -git clone -cd noise-supression-for-voice -cmake . -make \ No newline at end of file diff --git a/scripts/embedlibrnnoise.go b/scripts/embedlibrnnoise.go index 63d93b5..8204851 100644 --- a/scripts/embedlibrnnoise.go +++ b/scripts/embedlibrnnoise.go @@ -8,12 +8,9 @@ import ( ) func main() { - b, err := ioutil.ReadFile("librnnoise_ladspa/librnnoise_ladspa.so") + b, err := ioutil.ReadFile("librnnoise_ladspa/bin/ladspa/librnnoise_ladspa.so") if err != nil { fmt.Printf("Couldn't read librnnoise_ladspa.so: %v\n", err) - fmt.Println("Drop a compiled librnnoise_ladspa.so in at librnnoise_ladspa/librnnoise_ladspa.so,\n" + - "it will is required for compilation so we can embed it.\n\n" + - "You can find out more information in the README in that folder\n\n") os.Exit(1) } out, _ := os.Create("librnnoise.go")