[asterisk-users] music on hold file formats

Steve Edwards asterisk.org at sedwards.com
Tue Jun 23 21:41:01 CDT 2009


On Wed, 24 Jun 2009, Ron wrote:

> David Backeberg wrote:
>> On Tue, Jun 23, 2009 at 3:31 AM, Ron<nhadie at gmail.com> wrote:
>>>
>>> what software do i need to convert an mp3 to a g729 format?
>>
>> I'm not aware of a package to do it in one step. Sox can work with a 
>> large number of formats, but mp3 isn't one of them.

Sox can if it is compiled in. It isn't in CentOS.

> hi sir, i'm ok if there's two step, may i know what softwares are used 
> for those steps? preferably conversion is via CLI

I use:

) mplayer (if available) or "file" to determine if the file is an MP3.

) mpg123 to convert from MP3 to WAV (if needed).

) normalize so everything sounds about the same loudness.

) sox to make sure the channel count, sample size, "signedness" and 
sampling rate are correct. I'm only interested in WAV ("-c 1 -s -r 8000 
-w"), SLN ("-c 1 -r 8000 -s -t raw -w"), and ULAW ("-c 1 -r 8000 -t ul").

I "wrap" them all up in a script named "transcode.sh" to make it easy for 
me and my users to convert any old bunch of files with a single command.

Sox can't do g729, but Asterisk can using the CLI command

 	file convert <file_in.format> <file_out.format>

so you could extend the concept.

> my users are not technically knowledgeable on different file formats and 
> mp3's and wav are mostly what the users know. when they upload an MP3 i 
> would like to convert it and save it on different formats (e.g. g729 and 
> g711). thanks

If you get a choice, take the WAV and convert it to whatever formats you 
need -- skip MP3 altogether.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-users mailing list