|
COPYRIGHT 2005 VNU Business Media Europe
There are various ways to handle sound files in Unix and Linux. You can use applications dedicated to editing, mixing, creating effects, encoding and so on. But as with many things Unix, there are smaller utilities with more specific purposes.
One of the oldest and best-known sound utilities is 'Sox', short for 'sound exchange' (see http://sox.sf.net). The website describes the utility as the Swiss Army Knife of sound-processing programs. Its main day-to-day use is to convert audio from one format to another, similar to Imagemagick's 'convert' utility, which we have used in previous issues for converting image formats. There are many plain audio formats, though these days Microsoft's wav dominates. Like Imagemagick's utility, to convert one sound format to another, simply rename it with the desired extension, for example:
$ sox music.aiff music.wav
This straightforward command converts an Apple audio file (aiff) to the common Microsoft wav format. For simple conversions like these, Sox could not be easier. Unfortunately, for anything more complicated, Sox's command options need to be explored.
Sox is capable of applying various effects and modifications to an audio file. For example, it can normalise the sound - increase or decrease the amplitude without losing detail or causing distortion (see box on next page). This can be useful with some recordings that are made at a very low level. You can also apply filters, which are useful for compressing the sound to formats such as mp3. Effects such as reverb and panning are available, together with more useful ones such as fading out.
All of these take special options, which need to be presented on the command line in a certain order. We will start with the simplest: changing the amplitude. This is a format option and must be supplied before the audio file it affects. For example:
$ sox -v1.5 music.wav 4
music2.wav
(Key: 4 code string continues)
Here the amplitude of 'music.wav' is increased by 50 per cent (1.5) and the output saved in 'music2.wav'. The files will appear identical - they will have the same size and be the same length, but playing them will show the new file to be louder.
Depending on the audio file,...
Read the full article for free courtesy of your local library.
|