Added support for new "low bit-rate" narrowband mode.
authorjmvalin <jmvalin@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Tue, 11 Jun 2002 22:23:58 +0000 (22:23 +0000)
committerjmvalin <jmvalin@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Tue, 11 Jun 2002 22:23:58 +0000 (22:23 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@3377 0101bb08-14d6-0310-b084-bc0e0c8e3800

src/speexdec.c
src/speexenc.c

index 87a5d32..e4f5b98 100644 (file)
@@ -243,6 +243,10 @@ int main(int argc, char **argv)
                {
                   rate=8000;
                   mode = &speex_nb_mode;
+               } else if (strncmp((char *)op.packet, "speex narrow-lbr", 12)==0)
+               {
+                  rate=8000;
+                  mode = &speex_nb_lbr_mode;
                } else {
                   fprintf (stderr, "This Ogg file is not a Speex bitstream\n");
                   exit(1);
index e91fef5..d59da8b 100644 (file)
@@ -74,12 +74,13 @@ int main(int argc, char **argv)
    {
       {"wideband", no_argument, NULL, 0},
       {"narrowband", no_argument, NULL, 0},
+      {"lbr", no_argument, NULL, 0},
       {"help", no_argument, NULL, 0},
       {"version", no_argument, NULL, 0},
       {0, 0, 0, 0}
    };
    int rate, chan, fmt, size;
-
+   int lbr=0;
    ogg_stream_state os;
    ogg_page             og;
    ogg_packet           op;
@@ -101,6 +102,8 @@ int main(int argc, char **argv)
             narrowband=1;
          else if (strcmp(long_options[option_index].name,"wideband")==0)
                wideband=1;
+         else if (strcmp(long_options[option_index].name,"lbr")==0)
+               lbr=1;
          else if (strcmp(long_options[option_index].name,"help")==0)
          {
             usage();
@@ -184,7 +187,12 @@ int main(int argc, char **argv)
    if (!wideband)
       narrowband=1;
    if (narrowband)
-      mode=&speex_nb_mode;
+   {
+      if (lbr)
+         mode=&speex_nb_lbr_mode;
+      else
+         mode=&speex_nb_mode;
+   }
    if (wideband)
       mode=&speex_wb_mode;
 
@@ -208,6 +216,9 @@ int main(int argc, char **argv)
    {
 
       if (narrowband)
+      if (lbr)
+         op.packet = (unsigned char *)"speex narrow-lbr";
+      else
          op.packet = (unsigned char *)"speex narrowband";
       if (wideband)
          op.packet = (unsigned char *)"speex wideband**";