[xiph-cvs] cvs commit: speex/src speexenc.c wav_io.c

Jean-Marc Valin jm at xiph.org
Sat Oct 19 21:05:10 PDT 2002



jm          02/10/20 00:05:10

  Modified:    src      speexenc.c wav_io.c
  Log:
  support for 11.025 and 22.05 kHz audio

Revision  Changes    Path
1.48      +12 -0     speex/src/speexenc.c

Index: speexenc.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/speexenc.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- speexenc.c	11 Oct 2002 03:39:35 -0000	1.47
+++ speexenc.c	20 Oct 2002 04:05:10 -0000	1.48
@@ -371,6 +371,18 @@
       narrowband=1;
       if (wideband)
          fprintf (stderr,"Warning: encoding a narrowband file in wideband\n");
+   } else if (rate==22050)
+   {
+      wideband=1;
+      fprintf (stderr,"Warning: Speex is not optimized for 22.05 kHz sampling rate. Your mileage may vary\n");
+      if (narrowband)
+         fprintf (stderr,"Warning: encoding a wideband file in narrowband\n");
+   } else if (rate==11025)
+   {
+      fprintf (stderr,"Warning: Speex is not optimized for 11.025 kHz sampling rate. Your mileage may vary\n");
+      narrowband=1;
+      if (wideband)
+         fprintf (stderr,"Warning: encoding a narrowband file in wideband\n");
    }
 
    if (!wideband)

<p><p>1.6       +1 -1      speex/src/wav_io.c

Index: wav_io.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/wav_io.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- wav_io.c	11 Oct 2002 03:39:35 -0000	1.5
+++ wav_io.c	20 Oct 2002 04:05:10 -0000	1.6
@@ -96,7 +96,7 @@
    fread(&itmp, 4, 1, file);
    itmp = le_int(itmp);
    *rate = itmp;
-   if (*rate != 8000 && *rate != 16000)
+   if (*rate != 8000 && *rate != 16000 && *rate != 11025 && *rate != 22050)
    {
       fprintf (stderr, "Only 8 kHz (narrowband) and 16 kHz (wideband) supported\n");
       return -1;

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list