Tag Archives: automation

Samples selection and chopping workflow

  1. Download the naive-chopper script. LINK
  2. Add the path to the folder storing the script to the PATH
  3. Go to directory with WAV files to be chopped.
  4. For segments of length 30 run:
    1. $ for file in *.wav; do naive-audio-chopper.sh $file ../<output-dir>/; done
  5. For 60 seconds long segments run:
    1. $ DURATION=60;
    2. $ for file in *.wav; do naive-audio-chopper.sh $file ../<output-dir>/ $DURATION $STARTPOINT $ENDPOINT; done
    1. For 20 seconds long segments between 2:00 and 3:00 minute:
      1. $ DURATION=20;  STARTPOINT=120; ENDPOINT=180;
      2. $ for file in *.wav; do naive-audio-chopper.sh $file ../<output-dir>/ $DURATION $STARTPOINT $ENDPOINT; done

How to automatically process collection of sounds on Windows.

Recipe:

  1. Download and install sox. http://sourceforge.net/projects/sox/
  2. Run windows command line. “Start->Run Program-> type “cmd” and press enter.
  3. Enter directory storing files you want to process. (cd  command)
  4. Create directory for output files mkdir processed
  5. Run command:
    1. forfiles /m *.wav  /c “sox @path <sox-flags> <output_dir>\\@file”
      1. Variables starting with @ are CMD shell built-in varilables
      2. Variables in angle brackets should be specified by the user
  6. Voila. Results are available in the “processed” directory

Usage examples:

  1. Reduce bit depth to 16 bits
    1. for files /m *.wav  /c “sox @path -b 16 processed\\@file”
  2. FLAC files info
    1. for files /m *.flac /c “sox @path -n stats”

Sources:

[1] http://ss64.com/nt/forfiles.html

[2] Great explnatation by Hydrogen forum members about why one should always use dither when reducing bit rate.

 http://www.hydrogenaud.io/forums/index.php?showtopic=87045&st=0