shithub: sox

Download patch

ref: 65918d2fbc2194cc62f256b9e6c5d20008ba52cc
parent: 36cf67cc2e2fba179f652a4594bb81798c38fd7b
author: robs <robs>
date: Mon Nov 27 14:27:17 EST 2006

Fix VOX encoding setting/reporting.

--- a/src/misc.c
+++ b/src/misc.c
@@ -62,14 +62,15 @@
         "u-law",
         "a-law",
         "floating point",
-        "adpcm",
-        "ima_adpcm",
-        "gsm",
+        "ADPCM",
+        "IMA-ADPCM",
+        "GSM",
         "inversed u-law",
         "inversed A-law",
         "MPEG audio (layer I, II or III)",
         "Vorbis",
-        "FLAC"
+        "FLAC",
+        "OKI-ADPCM"
 };
 
 static const char readerr[] = "Premature EOF while reading sample file.";
--- a/src/st.h
+++ b/src/st.h
@@ -274,7 +274,8 @@
 #define ST_ENCODING_MP3         11/* MP3 compression */
 #define ST_ENCODING_VORBIS      12/* Vorbis compression */
 #define ST_ENCODING_FLAC        13/* FLAC compression */
-#define ST_ENCODING_MAX         13 
+#define ST_ENCODING_OKI_ADPCM   14/* Compressed PCM */
+#define ST_ENCODING_MAX         14 
 
 /* declared in misc.c */
 extern const char *st_sizes_str[];
--- a/src/vox.c
+++ b/src/vox.c
@@ -124,7 +124,7 @@
        ft->file.eof      = 0;
 
            ft->info.size     = ST_SIZE_WORD;
-       ft->info.encoding = ST_ENCODING_SIGN2;
+       ft->info.encoding = ST_ENCODING_OKI_ADPCM;
        ft->info.channels = 1;
 
        // ... initialise CODEC state
@@ -241,7 +241,7 @@
        ft->file.eof      = 0;
 
            ft->info.size     = ST_SIZE_WORD;
-       ft->info.encoding = ST_ENCODING_SIGN2;
+       ft->info.encoding = ST_ENCODING_OKI_ADPCM;
        ft->info.channels = 1;
 
        // ... initialise CODEC state