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

Paul Albrecht albrecht at glccom.com
Mon Aug 30 13:48:21 CDT 2010


On Mon, 2010-08-30 at 13:00 -0500, Kevin P. Fleming wrote:
> On 08/30/2010 11:15 AM, Paul Albrecht wrote:
> 
> >> No, that's enough, and it appears to be correct. I don't see any obvious
> >> reason why that would be failing. To debug it further, I'd change it to
> >> output AST_FORMAT_SLINEAR, and see if you get 160 samples; if not,
> >> you've found the step that is causing the problem, and if so, you've
> >> still found it :-)
> >>
> > 
> > I have already done that, but since I received that expected result, 160
> > samples, I figured it was likely a transcoding bug, so I posted to the
> > list. What else do you need? Is there a frame dump routine I can call
> > after I get the frame translated?
> 
> Then I would do one more check; produce an AST_FORMAT_SLINEAR frame
> directly and convert it to AST_FORMAT_ULAW, to see if something in the
> translation core is causing this problem as the frame moves between formats.
> 

A couple of things, first I misunderstood your previous post. What I
thought you were asking for was what you're asking for now, that is,
start with AST_FORMAT_SLINEAR and translate to AST_FORMAT_ULAW. Like I
said in my previous post I have done this and I get the expected result
(160 samples.)

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?

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.

> -- 
> 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
> 
-- 
Paul Albrecht




More information about the asterisk-dev mailing list