DP-32SD can not “grok” SOX generated .wav file

Sam Trenholme

Well-Known Member
Joined
Mar 9, 2015
Messages
96
Karma
102
Gear owned
DP-32SD
Without modifying the header, the Tascam DP-32SD is unable to “grok” (acknowledge as a valid .WAV file) a 24-bit 44.1khz monophonic .WAV file generated by the open-source SoX program, available here: http://sox.sourceforge.net/

Because of this, the Tascam DP-32SD is unable to import 24-bit/44.1 SoX-generated files via the “Audio Depot” unless the .WAV header is altered.

Steps to reproduce

Use the SoX program to generate a 24-bit wav file. For example:

sox foo.wav -b24 bar.wav gain -9

Put the resulting bar.wav file in the “Audio Depot” folder, and attempt to import the file in to the DP32SD.

Expected results

The file is visible and can be imported in to the DP-32SD.

Actual results

WAV files generated by Sox are not visible in the DP-32SD until they are altered.

Technical details

A Tascam DP-32SD has, for an “audio depot” 24/44.1 file header, the following bytes (this is “hexdump” format; the numbers on the left are hexadecimal numbers; the ASCII that follows is a representation of the data):

00000000 52 49 46 46 XX XX XX XX 57 41 56 45 66 6d 74 20 |RIFF....WAVEfmt |
00000010 10 00 00 00 01 00 01 00 44 ac 00 00 cc 04 02 00 |........D.......|
00000020 03 00 18 00 64 61 74 61 WW WW WW WW WW WW WW WW |....data........|

The “XX” bytes above are a 32-bit little-endian representation of the length of the file, and vary depending on the file length. “WW” is audio data.

SoX, on the other hand, generates a 24/44.1 wav file with the following header:

00000000 52 49 46 46 XX XX XX XX 57 41 56 45 66 6d 74 20 |RIFF....WAVEfmt |
00000010 28 00 00 00 fe ff 01 00 44 ac 00 00 cc 04 02 00 |(.......D.......|
00000020 03 00 18 00 16 00 18 00 04 00 00 00 01 00 00 00 |................|
00000030 00 00 10 00 80 00 00 aa 00 38 9b 71 66 61 63 74 |.........8.qfact|
00000040 04 00 00 00 14 f5 5f 00 64 61 74 61 WW WW WW WW |......_.data....|

Again “XX” is length, and “WW” is audio data.

The following C program takes a Sox-generated 24/44.1 Wav file on the standard input, and outputs a DP-32SD compatible file:

// Public Domain 2015 Sam Trenholme


// The DP32SD can not grok 24-bit/44.1 WAV files generated by SOX. This
// fixes the headers so that Tascam's DP32SD can understand them.

// Standard input: SOX-generated WAV file
// Standard output: DP32SD-comparible WAV file

#include <stdio.h>

main() {
int b;
int a;
for(a=0;a<16;a++) {
b = getc(stdin);
printf("%c",b);
}
int c;
printf("%c%c%c%c%c%c%c%c",0x10,0,0,0,1,0,1,0);
printf("%c%c%c%c%c%c%c%c",0x44,0xac,0,0,0xcc,4,2,0);
printf("%c%c%c%cdata",3,0,0x18,0);
for(a=0;a<60;a++) { getc(stdin); }
while(!feof(stdin)) {
b=getc(stdin);
if(!feof(stdin)) {printf("%c",b);}
}
}
 
The Sox developer who responded to my query there feels this is a bug on Tascam’s part.

To have Sox generate a WAV file compatible with the Tascam DP-32SD, make sure that “-t wavpcm” is part of the command line given to Sox. For example:

sox foo.wav -b24 -t wavpcm bar.wav gain -9

Technical summary

There are multiple different types of WAV files, but the DP32SD only understands a subset of them. If the digital multitrack unit doesn’t have the exact right kind of WAV file in the AudioDepot folder, the files will not even appear in the list of files when going to the Audio Depot menu of the DP32SD.

Technical detail

There are two main types of headers that a WAV file can have. One is the original WAVEFORMAT header; the sox developers feel that, while this WAVEFORMAT header can have arbitrary sample rate, number of channels, and bit depth, it should only be used for 8-bit and 16-bit PCM audio.

When using another bit depth, such as 24 bit, Sox by default outputs a different WAV header called WAVEFORMATEXTENSIBLE which is longer and stores more data. An example of this header is above; technical discussion of the format is here:

https://msdn.microsoft.com/en-us/library/dd390971.aspx
 
Since nobody uses that converter for anything, I would suspect that Tascam would not consider this a "bug." People who just want to do things with computers don't use open source software because we're not interested in screwing around, and WAV, AIF, MP3 and Ogg files are lingua franca... If SoX doesn't generate a header that a popular prosumer unit can't read (or "grok," if you insist), that's SoX's problem. One man's strong opinion. But thanks for the very professional report. ;)
 
This is for my own personal use:

A=11; for f in *flac ; do sox $f -b24 -t wavpcm $A.wav remix 1; A=$(( $A + 1 )); sox $f -b24 -t wavpcm $A.wav remix 2; A=$(( $A + 1 )); done

(This is UNIXeze, actually CygwinEze for “Take all of the stereo FLAC files in a directory and convert them in to the mono 24-bit files wav which the DP-32SD will correctly audio depot import”. Also: Sorry, UNIX Wizards, for the BASHism.)

The reason why I’m posting this here is so I don’t have to figure out how to do it all over again next time I need to import a bunch of tracks in to the DP-32SD. And, yes, I like the DP-32SD for its simplicity and minimalism, but things can quickly get to be really complicated if add a DAW to the mix, which I had to do when I lived in a place which wouldn’t fit my DP-32SD.
 
Last edited:
Yes:
Let me know if there are any problems (the above commands might have to be run in the directory Sox was installed in to).
 
I have downloaded but the program doesnt seem to run on my PC (Windows 10). I have one icon sox.exe and one wget.exe. When I click it something flashes up for a few microseconds but then nothing happens.
 
It’s a command line, not GUI application. To use the application, you need to open up a command line prompt; search for “cmd” in the start bar which should find cmd.exe.

How to use a command line prompt really goes beyond the scope of this message board, but supposing Sox is in C:\Program Files (x86)\Sox the recipe is like this:
  • Use the GUI to put the .wav files to convert in the same directory as the Sox program
  • Open up “Cmd”
  • Select the black window with grey text which opens up.
  • Type in this, without the quotes: “cd C:\Program Files (x86)\Sox\” Replace the second argument (the path to Sox) with the location of Sox on your system.
  • Type in something like “sox filename.wav -t wavpcm tascam.wav” as described above
  • A more through overview of the command prompt is at http://www.digitalcitizen.life/command-prompt-how-use-basic-commands
The command line isn’t for everyone, so, perhaps another poster can chime in with a GUI audio editor which outputs Tascam-compatible .wav files.
 
Thanks a lot! But a bit too much computer hacking I think. I will try.
 
Last edited:
How to convert 16-bit DP-32SD audio export files in to 24-bit files (same sample rate) so we can import them and make the mix (if not the tracks) have higher resolution:

for a in ../*WAV ; do sox $a -b24 -t wavpcm ${a##*_}-24bit.wav; done

${a##_} means “take the filename and remove everything before the final _ character.”
 

New posts

New threads

Members online