[Freeswitch-users] Problems with G722 sample rate

Michael Jerris mike at jerris.com
Mon Jul 8 20:50:37 MSD 2013

It may seem crazy, but you have to use 8000 for g722.  If audiocodes is really sending it as 16000 you need to report that to them.


4.5.2 G722

   G722 is specified in ITU-T Recommendation G.722, "7 kHz audio-coding
   within 64 kbit/s".  The G.722 encoder produces a stream of octets,
   each of which SHALL be octet-aligned in an RTP packet.  The first bit
   transmitted in the G.722 octet, which is the most significant bit of
   the higher sub-band sample, SHALL correspond to the most significant
   bit of the octet in the RTP packet.

   Even though the actual sampling rate for G.722 audio is 16,000 Hz,
   the RTP clock rate for the G722 payload format is 8,000 Hz because
   that value was erroneously assigned in RFC 1890 and must remain
   unchanged for backward compatibility.  The octet rate or sample-pair
   rate is 8,000 Hz.

On Jul 8, 2013, at 12:17 PM, Wesley Akio <wesleyakio at tuntscorp.com> wrote:

> Hi all,
> I'm having some trouble with G722 and AudioCodes HD310 in latest 1.2-stable...
> The phone sends the SDP:
> v=0
> o=1000 946688278 946688278 IN IP4
> s=-
> c=IN IP4
> t=0 0
> m=audio 4000 RTP/AVP 9 0 8 18 101
> a=rtpmap:9 G722/16000
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:18 G729/8000
> a=fmtp:18 annexb=no
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-15
> But Freeswitch is prepared to accept only G722 at 8000 as can be seen in:
> [DEBUG] sofia_glue.c:5181 Audio Codec Compare [G722:9:16000:20:64000]/[G722:9:8000:10:64000]
> For now I've changed the source to accept 16000 but according to Anthony, as per the RFC, 8000 is the correct value.
> I've seen some conversations between Nandy Dagondon ans Steven Ayre but I'm not sure if it is the same issue, nonetheless I could not find a solution.
> has anyone faced a similar problem and found a viable solution?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130708/5be9d937/attachment.html 

Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list