I am developing a recorder for VoIP audio, the sound is encoded using the g722 codec in the CISCO environment. Well, I extracted the data from the RTP frames, and I decrypted the pcm data as follows:
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;
outBuffSize = g722_decode(decode_state, decompressed, (const uint8_t*)payload, payloadSize);
I store the decoding data in the file (and all frames of the same stream equal to sscr), and when you try to hear the sound, I hear only noise.
I think this problem is for the concise algorithm used by CISCO.
The behavior of the decoded function is correct.
Any suggestion?
source
share