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?
精彩评论