shithub: opus

Download patch

ref: bc108e9aa69bb2f17048c0f9a456f051d88fb6c1
parent: 8c271d60c49c4c430bb1b41323017acef908a3a0
author: David <david@rowetel.com>
date: Fri Dec 7 06:29:13 EST 2018

checks that files opened OK

--- a/dnn/denoise.c
+++ b/dnn/denoise.c
@@ -650,8 +650,20 @@
     return 1;
   }
   f1 = fopen(argv[1], "r");
+  if (f1 == NULL) {
+      fprintf(stderr,"Error opening input .s16 16kHz speech input file: %s\n", argv[1]);
+      exit(1);
+  }
   ffeat = fopen(argv[2], "w");
+  if (ffeat == NULL) {
+      fprintf(stderr,"Error opening output feature file: %s\n", argv[2]);
+      exit(1);
+  }
   fpcm = fopen(argv[3], "w");
+  if (ffeat == NULL) {
+      fprintf(stderr,"Error opening output PCM file: %s\n", argv[2]);
+      exit(1);
+  }
   while (1) {
     kiss_fft_cpx X[FREQ_SIZE], P[WINDOW_SIZE];
     float Ex[NB_BANDS], Ep[NB_BANDS];
--