Convert to and from ulaw files

Posted in VoIP on January 31, 2010

0


In a previous article, we wrote about how to build a call recorder out of Asterisk.  Simply conference in the call recorder's extension and Asterisk will record your conversation to a ulaw file.  It is possible for Asterisk to record in wav format but that requires more system resources.  Fortunately, there's a very easy way to convert ulaw files to wav format.  That is by using a program called SoX.  SoX is an open source command line utility for converting many types of audio formats.


The way we set SoX up was by a Windows XP file type.  (No doubt the techniques for other versions of Windows would be similar.) Open Windows Explorer.  From the Tools menu, select Folder Options.  Navigate to the File Types tab.  Create a new file type with the extension ulaw.  Now select the extension you just created and press the Advanced button.  Create a new action and label it Convert to WAV.  The application used to perform the action is the following:

"C:\path\to\sox.exe" --no-clobber -t ul "%1" "%1.wav"

Wav files may be converted to ulaw using a similar technique.  The command is as follows:

"c:\path\to\sox.exe" --no-clobber "%1" -r 8000 -c 1 -t ul "%1.ulaw"

Bonus tip: if it's legal in your region, you may wish to disable the "beep beep" tone that's played when you conference an extension in.  To do this with a Linksys/Cisco VoIP device, set Conference Tone on the Regional tab to 0@-20.
 

Write a comment