### We have used the following block of code to convert the G722 data to PCM format :
public static byte[] DecodeG722(byte[] g722Data, int bitRate)
{
var codec = new G722Codec();
var state = new G722CodecState(bitRate, G722Flags.SampleRate8000);
var decodedLength = g722Data.Length * 2;
var outputBuffer = new byte[decodedLength];
var wb = new WaveBuffer(outputBuffer);
var length = codec.Decode(state, wb.ShortBuffer, g722Data, g722Data.Length) * 2;
if (length != outputBuffer.Length)
{
var outputBuffer2 = new byte[length];
Buffer.BlockCopy(outputBuffer, 0, outputBuffer2, 0, length);
outputBuffer = outputBuffer2;
}
return outputBuffer;
}
I suggest that you create only one codec and codec state object and pass each encrypted block in, rather than creating a new instance of each every block you receive.
### We have used the following block of code to convert the G722 data to PCM format :
audioCodecBitrate: 64000 sampleRate: 8000 channels: 1 bitRate: 16 packetizationTime: 20
Could you help us how to go about reducing noise and raise the quality of the audio.