5

I'm developing a call recorder for VoIP audio, the audio is encoded by using a g722 codec in a CISCO environment. Well, I have extracted the data from the RTPs frames and I have decoded this pcm data as follow:

unsigned int payloadSize = htons(udpHdr->len) - (CONSTANT::UDP_HDR_SIZE + CONSTANT::RTP_HDR_SIZE);
char * payload = (char*)rtpHdr + CONSTANT::RTP_HDR_SIZE;
  unsigned short m_payloadType = rtpHdr->pt;
//decode_state is initialize like :g722_decode_init(NULL, 64000, G722_SAMPLE_RATE_8000);
outBuffSize = g722_decode(decode_state, decompressed, (const uint8_t*)payload, payloadSize);

I store in a file this decode data (and all frames of the same flow, equal sscr) and when try to hear the audio, I only hear noise.

I think this problem is for the compressed algorithm used CISCO.

The behaviour of the decoded function is correct.

Any suggestion?

Miguel Angel
  • 630
  • 7
  • 18
  • Noise means you're decoding it incorrectly. Check your sample rate, bit rate, and per-sample byte ordering. Something that stands out is `G722_SAMPLE_RATE_8000`. G.722 is 16 kHz, not 8 kHz. Also, make sure the sender is not encrypting its payload. – indiv Oct 10 '11 at 18:36
  • OK,. the payload is not encrypting because the environment is controlled for me :). When i test with 16KHz and check the pre-sample ordering i'll write here. – Miguel Angel Oct 10 '11 at 20:33
  • I'm looking for in internet and in the oreka project, also they use G722_SAMPLE_RATE_8000 and Oreka is working correctly. I haven't tested oreka but it must working correctly. – Miguel Angel Oct 10 '11 at 21:17
  • Why it's tagged libpcap??? and why not using live555 lib and reinvent the wheel? – pmod Oct 11 '11 at 11:09
  • I am not trying reinvent the wheel, I'm trying develop an application. I have never seen live555 Is tagged with libpcap because I am sniffing the net traffic with this library... – Miguel Angel Oct 11 '11 at 15:14
  • Are you certain your UDP packets aren't fragmented and need re-assembly? – sarnold Feb 18 '12 at 01:47
  • @MiguelAngel did you ever figure out what was wrong? I am also trying to decode G722 audio from a Cisco phone system. What did you end up using/doing? – 11101101b Jul 23 '13 at 19:48

0 Answers0