[asterisk-dev] audiohook with G722 codec: wrong number of samples

Simon Sester sester at ind.rwth-aachen.de
Wed Apr 28 10:40:55 CDT 2010


I am running Asterisk SVN-branch-1.6.2-r258676.

I am developing a module using the audiohook api that modifies the data
of frames passed to the manipulate_callback function.

The G722 capable phones are connected to Asterisk using SIP.

When hooked to a channel (nativeformats = G722) the frame contains the
following information:
frame->datalen = 320
frame->samples = 160
frame->len = 20
ast_format_rate(chan->nativeformats) = 16000

But based on the codec and the reported samplerate I would expect 320
samples and a datalength of 640 in a frame of 20ms length:
16000Hz * 20ms * 1s/1000ms = 320 samples

Why don't the missing 160 frames reach the audiohook?

Thanks,
Simon





More information about the asterisk-dev mailing list