TwistedWave icon

TwistedWave

Main menu:

About this blog

Site search

Receive updates:


By FeedBurner

Categories

Archive

Automatically splitting an audio file

Manually cutting a long file into many different parts, and saving them as individual files can be very tedious and quickly take a lot of time. In this article, I will demonstrate how easily this can be done with TwistedWave, thanks to the built-in silence detector.

Detecting the silences

When you want to split an audio file, the first task consists in detecting the silences, parts of the audio where there is no or little sound. Each time a silence appears in the file, this is a place where it should be cut. The silence detector is perfectly suited to this job. From the main menu, click Select / Detect Silences…, and here is what you get:

Simple Silence Detector

The simplicity of the interface reflects the fact that the task is fully automatic, and TwistedWave is able to detect the silences without any extra configuration. If you are working on a more complex sound file where the difference between the silences and the useful sounds is not obvious, you can see below how the expert mode of the silence detector can be used to fine-tune the way TwistedWave tells the silences from the rest of the file.

When the silence detector is opened, it first analyzes the audio, and previews the silences by selecting them, like this:

Selected Silences

Seeing the image below may surprise you if you thought the selection always had to be contiguous. Well, it does not have to be, and this can be particularly useful in cases like this one. You can read more on non-contiguous selections.

When previewing the silences, you can start playing the audio, and TwistedWave will play all the selected silences. That way, you can make sure a useful sound was not selected by mistake.

After the audio was analyzed, from the pop-up button, you can select what to do with the silences in the audio file. When pressing the Apply button, one of several actions will be performed:

  • Select Silences. This option will select the parts of the audio containing silence.
  • Select Sounds. This is the opposite of the previous option, and only the areas not containing silence will be selected.
  • Place Markers. Markers will be automatically placed at the beginning and end of each detected silence.
  • Delete Silences. All the silences will be deleted.
  • Delete Silences and Mark. All the silences will be deleted, and some markers will be placed where the cuts were made.

The option we are going to use is Delete Silences and Mark, which will give this when applied:

Silences Cut and Marked

Naming the different parts

TwistedWave has automatically placed some markers at the places where the sound file should be cut. Now, it is convenient to give more explicit names to the markers, because they are going to be used to name the files.

Instead of double-clicking the markers one by one to rename them, the markers window provides a convenient way to rename all of them in one go. Double click the first one, and when you press return, the second is automatically selected to be renamed. You can also check the “Auto play” checkbox, and TwistedWave will automatically preview the audio starting at the marker you are renaming.

Renaming Markers

Splitting in individual files

Once you have placed the markers, and renamed them, the work is almost done. Select “Split by Markers” form the Markers menu, select the destination folder and file format, and TwistedWave does the rest:

Splitting by Markers

The expert silence detector

On some occasions, there is no clear distinction between the silences and the rest of the file, and the simple detector will not correctly locate the silences in the sound file. In that case, you should switch to the expert mode, and you will have access to a number of settings that allow you to fine-tune the detection.

The expert silences detector looks like this:

Expert Silence Detector

A number of new parameters are available to control the silence detection. They are:

  • Threshold. This parameter specifies the sound level in dB below which a sound is considered as silence. Note that when you open the silence detector, the sound file is analyzed, and this parameter is automatically set to a value that should be fine. You should only have to change this parameter in some cases where the distinction between sound and silence is less obvious.
  • Minimum silence duration. This parameter specifies the minimum duration below which a silence is not considered. This can be useful when detecting silences from a file containing spoken text, and a small pause between two words should not be considered as silence.
  • Minimum sound duration. This parameter specifies the minimum duration below which a sound is not considered as such, and will be treated as a silence. When a short noise is present during a silence, it can be desirable to still consider the silence as a whole, and ignore the sounds up to a given length.
  • Left and right padding. When you want to cut the silences from a sound file, it may be necessary to keep around a fraction of a second of audio before and after each sound. If the sound fades out at the end, for instance, it may be necessary to keep it a bit longer even after it drops below the silence threshold.

For best results, here is how you should set the different parameters in the expert detector:

  • First, set all the parameters to 0, except the threshold.
  • If necessary, fine-tune the threshold so that all the silences are detected, even if some silence is found in the useful sounds.
  • Increase the minimum silence duration just enough for the small silences in the middle of a sound to be ignored.
  • If necessary, increase the minimum sound duration to ignore a short noise inside a silence.
  • Increase the left and right padding values to keep a short silence before and after each useful sound.

Manually tweaking the silence detection

If the difference between the sounds and the silences is so small that the expert silence detector can’t make a correct detection, you still have the option to manually adjust the detection.

First, adjust the detection parameters as well as possible, and instead of cutting and marking the silences right now, select the option to “Select Silences”. Apply this, and close the silence detector.

Exactly as above, you should end up with a non-contiguous selection in the audio file:

Selected Silences

You can adjust this selection by:

  • Shift clicking its edges to adjust them.
  • Option-click and drag the mouse to add a region to the selection in order to mark a silence that would not have been detected.
  • Shift-Option-click and drag the mouse to remove a region from the selection to remove a silence that should be ignored, or to mark a sound that was ignored within a silence.

When this is done, make sure the option to Auto Mark Cuts is enabled, from the Markers menu, and press backspace, or Edit / Delete from the main menu. Then, export the files with “Split by Markers” and you are done.

Write a comment