Skip to content
This repository was archived by the owner on Nov 8, 2025. It is now read-only.
/ Re-Nooice Public archive

Commit fe0f012

Browse files
committed
Add mapi target
Signed-off-by: falkTX <falktx@falktx.com>
1 parent a9b6584 commit fe0f012

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ else
2323
gen:
2424
endif
2525

26+
# ---------------------------------------------------------------------------------------------------------------------
27+
# mapi target, to generate shared libraries
28+
29+
mapi: models
30+
$(MAKE) -C src mapi
31+
2632
# ---------------------------------------------------------------------------------------------------------------------
2733
# auto-download model files
2834

@@ -38,6 +44,8 @@ clean:
3844
$(MAKE) clean -C src
3945
rm -f deps/rnnoise/src/*.d
4046
rm -f deps/rnnoise/src/*.o
47+
rm -f deps/rnnoise/src/x86/*.d
48+
rm -f deps/rnnoise/src/x86/*.o
4149
rm -rf bin build
4250

4351
distclean: clean

src/Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
include ../deps/dpf/Makefile.base.mk
99

10+
ifeq ($(CPU_I386_OR_X86_64),true)
11+
ifneq ($(WASM),true)
12+
X86_RTCD = true
13+
endif
14+
endif
15+
1016
# ---------------------------------------------------------------------------------------------------------------------
1117
# Project name, used for binaries
1218

@@ -36,7 +42,7 @@ FILES_DSP = \
3642
$(RNNOISE_PATH)/src/rnnoise_data.c \
3743
$(RNNOISE_PATH)/src/rnnoise_tables.c
3844

39-
ifeq ($(CPU_I386_OR_X86_64),true)
45+
ifeq ($(X86_RTCD),true)
4046
FILES_DSP += \
4147
$(RNNOISE_PATH)/src/x86/nnet_avx2.c \
4248
$(RNNOISE_PATH)/src/x86/nnet_sse4_1.c \
@@ -47,6 +53,8 @@ endif
4753
# ---------------------------------------------------------------------------------------------------------------------
4854
# Do some magic
4955

56+
MAPI_MODULE_NAME = mapi_renooice
57+
5058
include ../deps/dpf/Makefile.plugins.mk
5159

5260
BASE_FLAGS += -DDISABLE_DEBUG_FLOAT
@@ -57,13 +65,17 @@ BASE_FLAGS += -I$(RNNOISE_PATH)/src
5765
# BASE_FLAGS += -fno-fast-math
5866
# -Wno-sign-compare -Wno-parentheses -Wno-long-long
5967

60-
ifeq ($(CPU_I386_OR_X86_64),true)
68+
ifeq ($(X86_RTCD),true)
6169
BASE_FLAGS += -DCPU_INFO_BY_ASM -DRNN_ENABLE_X86_RTCD
6270

6371
$(BUILD_DIR)/$(RNNOISE_PATH)/src/x86/nnet_avx2.c.o: BASE_FLAGS += -mavx -mfma -mavx2
6472

6573
$(BUILD_DIR)/$(RNNOISE_PATH)/src/x86/nnet_sse4_1.c.o: BASE_FLAGS += -msse4.1
6674

75+
else ifeq ($(WASM),true)
76+
77+
BASE_FLAGS += -U__AVX__ -U__SSE2__
78+
6779
endif
6880

6981
# ---------------------------------------------------------------------------------------------------------------------

src/PluginDSP.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ class ReNooicePlugin : public Plugin
148148
// ----------------------------------------------------------------------------------------------------------------
149149
// Init
150150

151-
void initAudioPort(bool input, uint32_t index, AudioPort& port)
151+
void initAudioPort(bool input, uint32_t index, AudioPort& port) override
152152
{
153153
port.groupId = kPortGroupMono;
154154

155155
Plugin::initAudioPort(input, index, port);
156156
}
157157

158-
void initParameter(uint32_t index, Parameter& parameter)
158+
void initParameter(uint32_t index, Parameter& parameter) override
159159
{
160160
parameter.hints = kParameterIsAutomatable;
161161
parameter.ranges.def = 0.f;
@@ -193,14 +193,19 @@ class ReNooicePlugin : public Plugin
193193
}
194194
}
195195

196-
float getParameterValue(uint32_t index) const
196+
float getParameterValue(uint32_t index) const override
197197
{
198198
return parameters[index];
199199
}
200200

201-
void setParameterValue(uint32_t index, float value)
201+
void setParameterValue(uint32_t index, float value) override
202202
{
203-
parameters[index] = value;
203+
switch (index)
204+
{
205+
case kParamEnableStats:
206+
parameters[index] = value;
207+
break;
208+
}
204209
}
205210

206211
// ----------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)