Sending packets from wireshark to audio decoder: Is .raw file array of RTP packets?

泪湿孤枕 提交于 2019-12-25 06:05:06

问题


I have captured RTP packets and need to decode the packets/sesssion with G.729.1 Decoder. In wireshark, I filtered the RTP packets, analyzed and saved the session as .raw file. I am using c# streamdecoder for decoding. Its sample provides example how the speech is encoded, saved in buffer and decoded packet by packet. This is the point I am stuck:

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 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); //enc is enc = new speechEncoder();
if (frame != null)
{
    // decode byte stream
    var packet = frame.GetNextPacket();
    var raw = dec.Decode(packet);
}

My problem is how can I send my .raw file, already saved in desktop for decoding ?

来源:https://stackoverflow.com/questions/30023323/sending-packets-from-wireshark-to-audio-decoder-is-raw-file-array-of-rtp-packe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!