[asterisk-dev] understanding ast_codec_get_samples for AMR

Dan Austin Dan_Austin at Phoenix.com
Tue Nov 21 14:37:02 MST 2006


Steve wrote:
> On 21/11/06, Steven Critchfield <critch at basesys.com> wrote:
>> You are assuming that we will always have only 20ms packets then.

> Even in the case of the normal "we're expecting 20msecs", I have seen
> the odd short packet in my iax testing.  Probably something went wrong
> somewhere else, but it should be handled.

1.4 is no longer is forced to 'assume' 20ms of audio per packet.
Each supported codec is documented with it's minimum payload,
maximum, default and increment, so that Asterisk can setup
a smoother between endpoints with different payloads.

As Steve Kann pointed out, fixed-bitrate codecs are easy, while
VBR codecs require more work.  The speex_sample() function in
frame.c is a good example.  

The other 'major' VBR codec, iLBC does less well at this point,
with the sample calculation code assuming iLBC is always 30ms.

Dan


More information about the asterisk-dev mailing list