[asterisk-users] 44Khz files in Asterisk 10

Kevin P. Fleming kpfleming at digium.com
Mon Jan 9 14:51:09 CST 2012


On 01/09/2012 02:32 PM, Lefteris Zafiris wrote:
> On Mon, 9 Jan 2012 13:59:07 -0600
> "Danny Nicholas"<danny at debsinc.com>  wrote:
>
>> Hi gang,
>>
>>                  I'm thrilled to be able to use a better quality sound
>> in Asterisk 10, but have to change my wav files to sln44 to get the
>> benefit. Is there some conf setting I'm missing that would let me
>> play a wav at 44 Khz instead of having to do this?
>>
>>
>>
>> Sox mon-0a.wav h-1a.wav -t raw -r 44100 jan01.sln44
>>
>>
>>
>> Not a biggie if no, since this is a decent work-around.
>
> At the moment format_wav only supports playback of 8 and 16kHz wav
> files, so for higher frequencies u have to use the raw slin format.
>
> Just another note, bumbing up the frequency of the sound files doesn't
> always means better sound quality. In most cases asterisk will have
> to resample the file before playing it back to you which will degrade
> the quality. In previous versions of asterisk codec_resample was using
> libresample which has very poor quality and introduces clipping and
> distortion in the resampled sound. Vesrion 10 has switched to speex
> resampler which is fast but not top quality, and its mainly
> tested and optimised with voice data so it wont be good to use for
> anything else, eg MOH.
>
> The optimal is to match the frequency of the codec you are
> using, eg 8kHz or 16kHz for wideband codecs. And if you have to
> resample use another resampler like sox (with dithering, lowpass etc)
> instead of letting asterisk do this for you.

In addition, 44.1kHz is not the best sample rate you could choose for 
content that will end up being transmitted over telephony (or 
telephony-derived) connections. Those connections all use sample rates 
that are multiples of 8kHz, and most resamplers do a better job of 
resampling audio when then source and target sample rates are integer 
multiples of each other. If you're going to convert the files from 
WAV/44.1kHz into another format with 'sox' anyway, also have it resample 
to 32kHz or 48kHz, as then you will make the later resampling easier in 
Asterisk.

However, unless you have endpoints that support sample rates higher than 
8kHz (or 16kHz) all of this is moot; you are better off to resample, in 
advance, to all of the sample rates that your endpoints support, and 
*also* to encode, in advance, in to the coding formats that your 
endpoints support. Providing Asterisk a 16kHz G.722-coded file of audio 
to send to a G.722 endpoint is far more efficient than providing it a 
44.1kHz PCM file.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming at digium.com | SIP: kpfleming at digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list