[asterisk-dev] downsampling slinear16 to ulaw (or alaw or g729)

Kevin P. Fleming kpfleming at digium.com
Mon Aug 30 14:15:20 CDT 2010


On 08/30/2010 01:48 PM, Paul Albrecht wrote:

> As for AST_FORMAT_SLINEAR16 to AST_FORMAT_SLINEAR translation, I get
> truncation, that is, instead of the 160 samples I was expecting I get
> 137 samples. I guess I don't know how to interpret these results, if
> slinear16/slinear results in truncation that's a bug, right?

Yes. That particular transcoding step is just resampling, and it should
produce exactly half as many samples as were input (unless an odd number
were input, of course).

> One more thing to mention, I have translated my silent frame to some
> other codecs from wide slinear without truncation. They are gsm, speex,
> and g722. Of course g722 is wide so that's not surprising, but I don't
> think gsm is wide and it is not truncated.

That's somewhat illogical; all paths to 8Khz codecs should go through
the same resampling step first, then into the codec. If there are
samples being dropped during resampling, it should occur for all of them.

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



More information about the asterisk-dev mailing list