next up previous contents
Next: Annotation, meta data and Up: Automatic Validation of Data Previous: Readability, Empty Files   Contents

$\bigcirc$ Signal format

Do the signal files contain correct standard formats? A good way to test this is sox5.1 (this test automatically implies readability!).
  sox -V $file -t raw /dev/null
This command will issue an error message, if sox cannot parse the sound file format (which must be known to sox! Check the man page!). The option -V will cause sox to print out information about the contents, such as
sox: Detected file format type: wav
sox: Chunk fmt
sox: Chunk data
sox: Reading Wave file: MS PCM format, 1 channel, 22050 samp/sec
sox:         44100 byte/sec, 2 block align, 16 bits/samp, 190840 data
sox: Chunk LIST
sox: Input file /usr/share/gallery/sounds/untie.wav: using
sample rate 22050
        size shorts, encoding signed (2's complement), 1 channel
sox: Input file /usr/opt/office52/share/gallery/sounds/untie.wav:
comment "1995-04-28
You may pipe this output into a script to detect deviations from the expected parameters, for example:
  sox -V $file -T raw /dev/null | \
  gawk -v FILE=$file '/Detected file/ { if($NF != "wav" ) \
  { printf("ERROR: file %s is not a valid WAV format\n",\
    FILE) } }'

Angela Baumann 2004-06-03