shithub: sox

Download patch

ref: b5b04948bce38297bef0811a1d0e3fd6b6eb7616
parent: 3927f747f919a38eada78fd77c3c5db224e96007
author: jching <jching>
date: Thu Jun 13 16:42:55 EDT 2002

add -d option to specify 64bit data size and changed Ulaw/Alaw encoding
to default to 8bit data size if not specified.

--- a/Changelog
+++ b/Changelog
@@ -26,6 +26,8 @@
     using the avg effect.
   o Richards Bannister added patches to clean up prototypes and filter
     private sizes being to small.
+  o Jimen Ching adds -d option to specify 64bit data size and changed
+    Ulaw/Alaw encoding to default to 8bit data size if not specified.
 
 sox-12.17.3
 -----------
--- a/src/sox.c
+++ b/src/sox.c
@@ -469,7 +469,7 @@
                         str = optarg;
                         if (! sscanf(str, "%d", &i))
                                 st_fail("-c must be given a number");
-			ft->info.channels = i;
+                        ft->info.channels = i;
                         break;
                 case 'b':
                         if (! ft) usage("-b");
@@ -483,6 +483,10 @@
                         if (! ft) usage("-l");
                         ft->info.size = ST_SIZE_DWORD;
                         break;
+                case 'd':
+                        if (! ft) usage("-d");
+                        ft->info.size = ST_SIZE_DDWORD;
+                        break;
                 case 's':
                         if (! ft) usage("-s");
                         ft->info.encoding = ST_ENCODING_SIGN2;
@@ -494,10 +498,14 @@
                 case 'U':
                         if (! ft) usage("-U");
                         ft->info.encoding = ST_ENCODING_ULAW;
+                        if (ft->info.size == -1)
+                            ft->info.size = ST_SIZE_BYTE;
                         break;
                 case 'A':
                         if (! ft) usage("-A");
                         ft->info.encoding = ST_ENCODING_ALAW;
+                        if (ft->info.size == -1)
+                            ft->info.size = ST_SIZE_BYTE;
                         break;
                 case 'f':
                         if (! ft) usage("-f");
@@ -1194,7 +1202,7 @@
                 fprintf(stderr, "Failed: %s\n", opt);
         else {
             fprintf(stderr,"gopts: -e -h -p -v volume -V\n\n");
-            fprintf(stderr,"fopts: -r rate -c channels -s/-u/-U/-A/-a/-i/-g/-f -b/-w/-l -x\n\n");
+            fprintf(stderr,"fopts: -r rate -c channels -s/-u/-U/-A/-a/-i/-g/-f -b/-w/-l/-d -x\n\n");
             fprintf(stderr, "effect: ");
             for (i = 0; st_effects[i].name != NULL; i++) {
                 fprintf(stderr, "%s ", st_effects[i].name);