SplitIt

The Sound File Splitter

version 1.3


SplitIt is a graphical Tcl/Tk application that enables you to quickly split sound files into segments, which are stored in labeled files. It is very useful for segmenting sentences into words or other pieces. It can handle numerous sound file formats, including WAVs and MP3s, and can operate on any files large enough to fit into your computer's memory. Its friend MergeIt is a simple command-line tool for concatenating segments. NormIt is used to normalize the power level (volume) in sound files. FadeIt applies a linear fade in to the start or fade out to the end of a sound file to reduce abrupt discontinuities. PlayIt is a simple sound file player.

View a Screenshot

InstallingIt

In order to use these tools, you must install Tcl/Tk, including the Snack package.

For Linux systems, Tcl/Tk comes standard but you may need to follow the instructions for compiling and installing Snack.

For Mac OS X computers, you will need to install Tcl/Tk Aqua. The latest version comes with Snack.

On Windows machines, you should install the ActiveTcl binaries from the Scriptics website. On Windows machines, I recommend also downloading the Cygwin utilities, which includes a terminal window and other useful tools.

SplitIt must be run from the command-line in a terminal window. Before you can run it you will need to make the programs executable:

chmod a+x *It.tcl

RunningIt

SplitIt should be run on the command-line as follows:

splitIt.tcl [options] [sound_files]

The options are:
-w width Sets the initial width of the waveform, in pixels.
-h height Sets the height of the waveform, in pixels.
-r pix/sec Sets the waveform resolution in pixels per second.
-n power Source files will be normalized to this avg power (in dB). 65 is a reasonable value.
-f file Sets the file from which the names of the input sound files are loaded.
-l file Sets the file from which the default segment labels are loaded.
-s file Sets the default file from which segment info is loaded if one is not found
-d dir Sets the directory in which the segment files will be stored.
-t type Sets the output sound file format. The options are WAV (default), AU, SND, AIFF, SMP, CSL, and RAW.
-c file SplitIt will run the Tcl code in the given command file before starting. This can be used for advanced customization.
-aAutomatically re-split the files and exit.

You must specify at least one sound file, either on the command line following the options or in a file list using the -f option. If files are specified both on the command line and in a file list, the lists will be concatenated.

A dash, -, can be used in place of the filename following -f or -l to read the source files or labels from standard input.

If a power level is specified with the -n option, the volume of the source file will be normalized when it is loaded. The power is in dB. 60-65 are reasonable levels. 40 would be very soft. Setting the power above 70 is likely to result in clipping.

If the -a option is used, SplitIt will run in auto mode. It will go through the sound files and for each one, if a matching .spl file can be found in the segment file directory, it will be loaded and the sound file will be re-split. This is useful if the segment files have been erased or if you want to re-normalize the level of the input file, which should be done prior to splitting so the segments have matching levels.

UsingIt

Once a file is loaded, you will see its waveform in the upper panel. You can scale the waveform using the slider on the right. Initially, the file contains a single segment. Left-click on the waveform to create a marker, splitting the segment in two.

You can continue to left-click to create more segments. If you place the cursor over a marker, it will turn yellow and you can drag it left or right. Right-click (or control-click) on a marker to delete it. The Clear Marks button will remove all of the markers, resetting to a single segment.

The Play File button plays the entire sound file. Or you can right-click (control-click) on a segment to play just that segment. If the Auto Play Segment option is checked, the segment adjacent to the marker will be played whenever you create or move a marker. Whether it plays the segment on the left or right depends on the direction from which you approached the marker with the cursor. When you split a segment, the shorter half will be auto-played.

The panel in the lower left shows details of the segments, including a segment's start time, end time, and length (in seconds), whether it is a "good" segment, and its label. Only good segments will be stored when the file is split and only good segments can be labeled. Good segments are blue, bad ones are red. You can toggle whether a segment is good or bad either by clicking the checkbox next to the segment's label or by pressing the spacebar when the mouse is over the segment in the waveform display.

When you click the Split It! button, the good segments are written to files, and a special .spl file, which stores the segment lengths and their labels, is generated. This will be loaded the next time you edit the source file, so you can easily adjust the markers and re-split the file. If you provide the name of a .spl file using the -s option, that file will be used when the source is loaded if there is no .spl file whose name matches the source file. If a .spl is found whose name matches the source file, it will be used instead of the one given with the -s option. If you press the Revert to Saved button, the stored segment data will be reloaded.

By default, the segment and split files are stored in the same directory as the source file. This can be changed with the -d option. You may want to keep your source files and segments in different directories, or keep each source file and its segments in its own directory.

The name of a segment file is composed of the original name of the sound file, followed by a dash and the segment's label. By default, the good segments are numbered 1, 2, 3..., but you can edit the labels to create custom ones. The -l option can also be used on the command line to specify a file containing default custom labels. The file should contain one label per line. This is useful when performing the same segmentation on a series of files.

If more than one file was specified on the command line, the Next File and Previous File buttons can be used to step through the list of sound files. If you don't press the Split It! button before changing source files, your changes will be lost.

The -c option can be used for advanced customization. It allows you to provide Tcl code that will be executed after the procedures are defined in splitIt.tcl but before the windows are built. This can be used to change the default parameters, such as the colors, and to override any of the internal functions.

MergeIt

The MergeIt program can be used to concatenate sound files into a single file. It is run as follows:

mergeIt.tcl in_file1 in_file2... out_file

The arguments simply consist of a list of file names. The last argument is the output file and all others are the input files. The extension of the output file determines the format in which it will be written. Recognized formats are .wav, .au, .snd, .aiff, .smp, .csl, and .raw.

NormIt

The NormIt program is used to normalize the volume of one or more sound files. NormIt distinguishes silent regions and ignores them in computing the mean volume, so the actual volume should not be affected by the duration of the silence. It is run as follows:

normIt.tcl [option | file] [option | file]....

NormIt takes a series of command-line arguments, which can either be options or filenames. Each file encountered on the command-line will be normalized using the options that precede it. The options are:

-p power Sets the power level for the normalization. Default: 65
-bd dir Sets the directory in which backups are saved.
-be ext Sets the extension appended to backup files.
-nd dir Sets the directory in which normed files are saved.
-ne ext Sets the extension appended to normed files.

The -p options sets the power to which the file is normalized. This is expressed in dB. The default is 65. Reasonable levels may be 55-70. Below 50 would be very soft and above 70 may result in serious clipping. If there is clipping, a warning message is printed to the console.

By default, the normalized version of the file overwrites the original. The -bd option sets the directory in which a backup of the original file is saved. The default is the same directory. The -be option sets the extension that is appended to the backup file. It defaults to the empty string. You may want to set it to "-bak". If neither -bd nor -be is set, no backup is saved.

By default, the new file overwrites the original. The -nd and -ne options change the directory and extension of the normalized file.

Here is how one might normalize a file to three different levels, saving the results in the Norm directory:

normIt.tcl -nd Norm -p 55 -ne "-55" foo.wav -p 60 -ne "-60" foo.wav -p 65 -ne "-65" foo.wav

FadeIt

When slicing up sound files, a segment is sometimes left with an abrupt transition at the start or end that results in an audible click sound. Therefore, it is often helpful to do a quick ramp in or ramp out of the amplitude. This can be done with the FadeIt program.

fadeIt.tcl [option | file] [option | file]....

FadeIt behaves very similarly to NormIt, but instead of setting the power you can set the length (in msec) of the initial ramp up and final ramp down. Each file encountered on the command-line will be normalized using the options that precede it. The options are:

-s msec Sets the length of the initial ramp up. Default: 20
-e msec Sets the length of the final ramp down. Default: 20
-bd dir Sets the directory in which backups are saved.
-be ext Sets the extension appended to backup files.
-nd dir Sets the directory in which normed files are saved.
-ne ext Sets the extension appended to normed files.

See the description of NormIt for an explanation of the -bd, -be, -nd, and -ne parameters.

PlayIt

PlayIt is a simple sound file player. It can take a volume argument and a series of filenames, which will be played in sequence. It is used as follows:

playIt.tcl [option | file] [option | file]....

The option is:

-v volume Sets the volume (0-100).

You could play a sound at three different volumes like this:

playIt.tcl -v 25 foo.wav -v 50 foo.wav -v 75 foo.wav