Category Archives: Audio Technical

Batch Convert WAV to a-law or u-law on a Mac

So I’ve been having to do a few conversions of WAV files for old phone systems that require either u-law or a-law encoded audio a bit lately. I’ve been using sox in terminal but decided I need to speed things up a little so decided to create a shell script to process the audio.

On a Mac with this simple script all you need to do is to dowload SoX and put the sox folder at the base level of your filesystem (on your mac HD) at /sox. You can change this in the script by altering the soxloc=”/sox/sox”; line

Then all you need to do is open the Terminal and first drag the script on to the window. Then just drag the folder that contains all the audio files and hit enter.

The script will start looping through the files and converting each one.

You can change any of the parameters like sample rate or encoding just by altering the “-r 8000 -c 1 -e u-law” part

#! /bin/sh

echo "WAV to u-law converter script by Sandy Milne V1" 

shopt -s nullglob
for f in "$1"/*.wav
	echo "Processing - $f"
	"$soxloc" "$f" -r 8000 -c 1 -e u-law "${f%.*}"-ulaw.wav

You can download the script here:

Hope it’s useful.

OP 59 and Loudness Standards for Australian TV

For as long as I have been working at Risk Sound, and in fact since I started in the audio post production industry, Operational Practice 48 (or OP 48) has been the standard when mixing for broadcast on Australian TV. OP48 is a little vague and is generally enforced differently, depending on which TV station your soundtrack is being broadcast on. OP 48 is also based on VU and Peak level which is more a measure of the electrical signal of the audio rather then how loud the soundtrack actually seems to the listener. This meant that by using a bit of multiband compression and EQ you could make the sound seem louder while keeping in check with the OP48 requirements.
The new OP 59 requirements that come into effect on the 1st of January 2013 in Australia and New Zealand aim to move Australia into line with the the US, Europe and many other places in the world who now measure soundtracks based on the average perceived loudness of the soundtrack.
But how does a machine or computer measure how a human perceives loudness? I hear you ask. The answer is an algorithm developed by The International Telecommunication Union or ITU which is referred to as ITU-R BS.1770, the current evolution of which is ITU-R BS.1770-3.
Using a meter that conforms to ITU-R BS.1770-3 you can actually get a quantitative measure of the loudness of a soundtrack. OP 59, like the US and European standards, specifically looks at (or listens to) the average or integrated loudness of the entire program . So if you were mixing a 30 second TV soundtrack you have to play the entire 30 seconds through the meter to arrive at your LKFS value, which for OP 59 -24LKFS.
L stands for for loudness, K describes the filtering algorithm used, and FS stands for for full scale. If you are mixing a long form soundtrack for TV that was 30 minutes long you would also have to follow the same procedure although file based processing systems now can scan an audio file faster than real-time are also to be used.

The other part to OP 59 is the True Peak limit of -2dBFS. Many software limiters only measure the peak of the audio samples, not the waveform that will be created when those samples are converted back into the analog domain. This means that your audio signal may actually be distorting and clipping on playback or when being converted to lossy codecs such as MP3 or AAC which don’t handle this clipping very well and introduce distortion. Meters that conform to ITU-R BS.1770-3 should aksi have a true peak indication as well.

OP 59 is definitely a step in the right direction and will hopefully address the issue of jumps in loudness between ads, station promos and tv programs. Because we are now mixing to an average loudness it also means that sound engineers can be more dynamic when creating soundtracks. Basically if you add a loud bit you just need a soft bit and you’ll be back in spec (although not too soft as 1770-2 introduced a gate that removes low level audio from the calculation).

As ITU-R BS.1770-3 is an open standard many companies are now creating desktop and web based audio scanning systems which can check if audio conforms to the new loudness level requirements. Some even adjust the soundtrack so that it will meet the spec. While checking a soundtrack via this software is great from a quality control angle I think using it to normalise, or fix as some claim, the entire soundtrack is not a good idea. For instance if a soundtrack has been mixed to the old OP 48 or similar and has been heavily compressed, running it through the metering algorithm and simply normalising it to bring the loudness down will result in a mix that will sound soft and a lot less dynamic/interesting on air.
For me the responsibility still lies with mix engineer to use the new freedoms/restrictions of OP 59 to their advantage and to basically know what will sound good on air and what won’t. Computers are still a few years off that… I hope

You can download the OP 59 spec sheet as a pdf from freeTV here: