فهرست منبع

Trying to link the static build differently. I'm such a noob.

Luciano Dato 8 سال پیش
والد
کامیت
e056b2d451
2فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 4 1
      Makefile
  2. 3 3
      src/sdenoise.c

+ 4 - 1
Makefile

@@ -59,6 +59,8 @@ override CFLAGS += `pkg-config --cflags lv2`
 ifneq ($(shell test -f rnnoise/.libs/librnnoise.a || echo no), no)
   LV2CFLAGS=$(CFLAGS) -Irnnoise/include
   LOADLIBES=rnnoise/.libs/librnnoise.a -lm
+else
+	$(error "RNNoise library was not found")
 endif
 
 #for debug building
@@ -90,7 +92,8 @@ $(BUILDDIR)$(LV2NAME)$(LIB_EXT): $(SRCDIR)$(LV2NAME).c
 	@mkdir -p $(BUILDDIR)
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(LV2CFLAGS) \
 		-o $(BUILDDIR)$(LV2NAME)$(LIB_EXT) $(SRCDIR)$(LV2NAME).c \
-		-shared $(LV2LDFLAGS) $(LDFLAGS) $(LOADLIBES)
+		-shared $(LV2LDFLAGS) $(LDFLAGS) \
+		-static -l$(LOADLIBES)
 
 ifeq ($(DEBUG), 0)
 	$(STRIP) $(STRIPFLAGS) $(BUILDDIR)$(LV2NAME)$(LIB_EXT)

+ 3 - 3
src/sdenoise.c

@@ -36,7 +36,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/
 
 #define SDENOISE_URI "https://github.com/lucianodato/speech-denoiser"
 
-#define FRAME_SIZE 480 //Frame default size
+#define FRAME_SIZE 480 //Frame default size (For 48 kHz sampling rate)
 
 #define M_PI 3.14159265358979323846f
 
@@ -172,9 +172,9 @@ run(LV2_Handle instance, uint32_t n_samples)
 	//main loop for processing
 	for (pos = 0; pos < n_samples; pos++)
 	{
-		//Store samples in the input buffer
+		//Copy samples in the input buffer
 		self->in_fifo[self->read_ptr] = self->input[pos];
-		//Output samples in the output buffer (even zeros introduced by latency)
+		//Output samples in the output buffer
 		self->output[pos] = self->out_fifo[self->read_ptr];
 		//Now move the read pointer
 		self->read_ptr++;