[xiph-commits] r9310 - trunk/speex/libspeex

jm at motherfish-iii.xiph.org jm at motherfish-iii.xiph.org
Tue May 24 22:45:36 PDT 2005


Author: jm
Date: 2005-05-24 22:45:35 -0700 (Tue, 24 May 2005)
New Revision: 9310

Modified:
   trunk/speex/libspeex/testecho.c
Log:
Added command line


Modified: trunk/speex/libspeex/testecho.c
===================================================================
--- trunk/speex/libspeex/testecho.c	2005-05-25 05:06:31 UTC (rev 9309)
+++ trunk/speex/libspeex/testecho.c	2005-05-25 05:45:35 UTC (rev 9310)
@@ -14,7 +14,7 @@
 
 #define NN 160
 
-int main()
+int main(int argc, char **argv)
 {
    int echo_fd, ref_fd, e_fd;
    float noise[NN+1];
@@ -22,9 +22,14 @@
    SpeexEchoState *st;
    SpeexPreprocessState *den;
 
-   echo_fd = open ("play.sw", O_RDONLY);
-   ref_fd  = open ("rec.sw",  O_RDONLY);
-   e_fd    = open ("echo.sw", O_WRONLY | O_CREAT | O_TRUNC, 0644);
+   if (argc != 4)
+   {
+      fprintf (stderr, "testecho mic_signal.sw speaker_signal.sw output.sw\n");
+      exit(1);
+   }
+   echo_fd = open (argv[2], O_RDONLY);
+   ref_fd  = open (argv[1],  O_RDONLY);
+   e_fd    = open (argv[3], O_WRONLY | O_CREAT | O_TRUNC, 0644);
 
    st = speex_echo_state_init(NN, 8*NN);
    den = speex_preprocess_state_init(NN, 8000);



More information about the commits mailing list