Tracking Audio Files with shntool for OS X

shntool has a neat little feature built in that allows you to track a large audio file and split it into separate songs. This is similar to CD Wave on the Windows platform. Your first step is to translate your AIFF format file into a WAV format file with an application like SoundApp (if your audio file isn't already in WAV format). Likewise you can convert your audio file to WAV with QuickTime or any other audio program that supports it. shntool doesn't have support for AIFF files so you'll need to save it as a WAV file. This is a pretty easy process. Just save it as a 16 bit, 44.1kHz PCM WAV file and you're set for the next step.

Next you'll need to know the endpoints of all your tracks. You can do this with an application called SoundHack, which is both OS 9 and OS X compatible. Here's a screenshot:

At the bottom there is your soundfile. Write down (or save yourself a step and type it into a text file) your track endtimes. In the picture below the first time is the endpoint of track 1. Likewise, the second time is the endtime of track 2 and so on.

So continue doing that for all the tracks in the soundfile. I have my offsets in mm:ss.ff format (minutes, seconds and frames). You can enter them in either bytes, minutes and seconds (mm:ss), minutes, seconds and frames (mm:ss.ff) or minutes, seconds and milliseconds (mm:ss.nnn). If your audio file is longer than an hour, and let's say that a track ends at 1 hour, 18 minutes and 30 seconds, you'd enter in 78:30. Note that if you enter in your track endtimes with the millisecond value, shntool will most likely move your track breaks to the previous sector boundary if your given values are not correct. So in this case I would recommend using the frames value.

Now that you have all the times entered it's time to save the file in a special format. If you're using BBEdit, click on the Options button in the Save window.

Save the file as a generic text file, no state, and with Unix line breaks. That last part is very important. Save the file, possibly naming it d1offsets.txt and put it in the same folder as your audio file. If you're using SimpleText or Text Editor or something besides BBEdit, you'll need to hit enter twice after each track time.

Now open up Terminal and cd to the folder which contains both your big audio file and your offsets file. In my case, my offsets file is named d1offsets.txt and my big audio file is called dftm-d1.wav. Type:

shntool split -f d1offsets.txt -o wav -n dftm2002-02-14d1t dftm-d1.wav

And shntool will then split your audio file based on the offsets file you entered. In the text above, -o wav tells shntool to make the output tracks WAV format (alternately you can save them as SHN files but I don't recommend this as you'll see later). -f d1offsets.txt tells shntool that the offset file it's supposed to read is named d1offsets.txt. -n dftm2002-02-14d1t tells shntool that each file should be named dftm2002-02-14d1t**.wav where ** is the ascending track number (01, 02, 03, 04, etc.). Very handy! And finally dftm-d1.wav is the file shntool is reading from. The process is very quick and each track is cut on sector boundaries, however, in my experience shntool will not cut the last track on a sector boundary if you use a millisecond or frames value. If you get a warning message telling you that shntool will round your offset, don't worry. It will just change your track endtime to the nearest sector boundary.

So shntool is done cutting the big wav file. A good idea before you SHN them is to open them up with SoundHack or QuickTime Player or any other audio player and make sure they start when you want them to. If not, you'll need to retrack the whole show. Delete all the small wav's and keep the big audio file and edit your offsets file.

If you're happy with them, SHN them and you're done! Pretty nice.