From 917ac125e8c65b0af3e4d0ae1d3efbeda89fcd79 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Fri, 21 Jul 2017 09:34:11 -0400 Subject: [PATCH] cleanup --- src/denoise.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/denoise.c b/src/denoise.c index 3911ebd..9cb0e22 100644 --- a/src/denoise.c +++ b/src/denoise.c @@ -187,7 +187,7 @@ static void frame_synthesis(DenoiseState *st, float *out, const kiss_fft_cpx *y) RNN_COPY(st->synthesis_mem, &x[FRAME_SIZE], FRAME_SIZE); } -static void rnnoise_process_frame(DenoiseState *st, float *out, const float *in) { +void rnnoise_process_frame(DenoiseState *st, float *out, const float *in) { kiss_fft_cpx y[FREQ_SIZE]; frame_analysis(st, y, in); /* Do processing here. */ @@ -204,6 +204,10 @@ int main(int argc, char **argv) { DenoiseState *noisy; st = rnnoise_create(); noisy = rnnoise_create(); + if (argc!=4) { + fprintf(stderr, "usage: %s \n", argv[0]); + return 1; + } f1 = fopen(argv[1], "r"); f2 = fopen(argv[2], "r"); fout = fopen(argv[3], "w"); @@ -252,16 +256,5 @@ int main(int argc, char **argv) { fclose(f1); fclose(f2); fclose(fout); -#if 0 - memset(x, 0, sizeof(x)); - x[0] = 1; - x[1] = -1; - rnnoise_process_frame(st, x, x); - for (i=0;i