I captured RTP packets and should decode packets / descriptors using the G.729.1 Decoder. In wirehark, I filtered out RTP packets, analyzed and saved the session as a .raw file. I am using C # streamdecoder for decoding. His example provides an example of how speech is encoded, stored in a buffer, and packet per packet decoded. Here's what I'm stuck with:
const Codec usedCodec = Codec.G7291;
const int usedSampleRate = 8000;
const int usedBitrate = 12200;
var dec = new SpeechDecoder();
dec.SetCodec(usedCodec);
dec.Bitrate = usedBitrate;
Now in the sample, it takes data from the buffer as:
var win = new WaveInput();
var samples = win.GetNextSamples().Buffer.Array;
bytescollected += samples.Length;
var frame = enc.EncodeToFrame(samples);
if (frame != null)
{
var packet = frame.GetNextPacket();
var raw = dec.Decode(packet);
}
My problem is, how can I send a .raw file already saved on the desktop for decoding?
source
share