This page provides a collection of useful scripts (mostly PERL) for automating audio processing (mostly using SoX). Get “SoX – Sound Exchange” from here:

The scripts assume installation in /usr/local/bin. Optionally, change that in the “configurables” section of the script. Install my scripts in /usr/local/bin (or anywhere else in your path)


  • sox_loop (PERL) – Useful for creating Phantom Words. Create a WAV file with a single iteration then loop it (specifying either the number of loops or total duration) and the fade in and fade out time. The default is 120 seconds with fades of 10 seconds. Optionally show detailed statistics or run in test mode (doesn’t actually run SoX).

    Usage: sox_loop FILENAME.wav  [–loops LOOPS –fade FADETIME –stats –verbose]
    or: sox_loop FILENAME.wav  [-l LOOPS -f FADETIME -s -v]


    Use defaults (looped for 120 seconds, 10 second fades):
       % sox_loop phantom1_cropped.wav  
    100 loops, 5 second fades:
       % sox_loop phantom1_cropped.wav -l 100 -f 5
    90 seconds of looping with 1 second fades:
       % sox_loop phantom1_cropped.wav -d 90 -f 1
    90 seconds of looping with 0 second fades (no fades):
       % sox_loop phantom1_cropped.wav -d 90 -f 0 -s