|
From: Jan S. <ha...@st...> - 2010-03-10 07:24:18
|
On Mar 09 16:32:10, Jie Wu wrote: > I was trying to convert a OKI ADPCM audio file > (http://www.nch.com.au/acm/sample.vox) using the following command: > sox -t raw -r 8000 -c 1 -e oki-adpcm sample.vox test.wav > > It always gives me "sox FAIL formats: bad input format for file > `sample.vox': data encoding was not specified" error. This is how soxi(1) sees the file: $ soxi sample.vox soxi WARN raw: `sample.vox': sample rate not specified; trying 8kHz Input File : 'sample.vox' Channels : 1 Sample Rate : 8000 Precision : 12-bit Duration : 00:00:04.40 = 35194 samples ~ 329.944 CDDA sectors File Size : 17.6k Bit Rate : 32.0k Sample Encoding: 4-bit OKI ADPCM Apparently, trying 8k is a good idea; at least play(1) plays the file correctly: $ play -V sample.vox gain -6 play: SoX v14.3.0 play WARN raw: `sample.vox': sample rate not specified; trying 8kHz Input File : 'sample.vox' Channels : 1 Sample Rate : 8000 Precision : 12-bit Duration : 00:00:04.40 = 35194 samples ~ 329.944 CDDA sectors File Size : 17.6k Bit Rate : 32.0k Sample Encoding: 4-bit OKI ADPCM Reverse Nibbles: no Reverse Bits : no Output File : 'default' (sndio) Channels : 1 Sample Rate : 8000 Precision : 16-bit Duration : 00:00:04.40 = 35194 samples ~ 329.944 CDDA sectors Sample Encoding: 16-bit Signed Integer PCM Endian Type : little Reverse Nibbles: no Reverse Bits : no play INFO sox: effects chain: input 8000Hz 1 channels play INFO sox: effects chain: gain 8000Hz 1 channels play INFO sox: effects chain: dither 8000Hz 1 channels play INFO sox: effects chain: output 8000Hz 1 channels In:23.3% 00:00:01.02 [00:00:03.38] Out:8.19k [ =====|===== ] Clip:0 I don't understand why you are specifying the encoding, channels, etc. It's all in the vox header (except the rate is not, but sox guesses it correctly as 8k). The easiest possible thing just works: $ sox -V sample.vox sample.wav sox: SoX v14.3.0 sox WARN raw: `sample.vox': sample rate not specified; trying 8kHz Input File : 'sample.vox' Channels : 1 Sample Rate : 8000 Precision : 12-bit Duration : 00:00:04.40 = 35194 samples ~ 329.944 CDDA sectors File Size : 17.6k Bit Rate : 32.0k Sample Encoding: 4-bit OKI ADPCM Reverse Nibbles: no Reverse Bits : no Output File : 'sample.wav' Channels : 1 Sample Rate : 8000 Precision : 12-bit Duration : 00:00:04.40 = 35194 samples ~ 329.944 CDDA sectors Sample Encoding: 16-bit Signed Integer PCM Endian Type : little Reverse Nibbles: no Reverse Bits : no Comment : 'Processed by SoX' sox INFO sox: effects chain: input 8000Hz 1 channels sox INFO sox: effects chain: output 8000Hz 1 channels sox WARN adpcms: sample.vox: ADPCM state errors: 8 The resulting sample.wav sounds just fine. (Don't know what "ADPCM state errors" are, though.) Jan |