将一个wav 档,封装成RTP Packet
RTP Header定义
struct RTP_HEADER
{
unsigned char csrc_len:4;
unsigned char extension:1;
unsigned char padding:1;
unsigned char version:2;
unsigned char payload:7;
unsigned char marker:1;
uint16_t seq_no;
uint32_t timestamp;
uint32_t ssrc;
};
wav header 定义如下:
struct WAV_HEADER {
uint32_t riff_id; //big endian --RIFF
uint32_t riff_sz; // 36+ data_sz
uint32_t riff_fmt; //big -- WAVE
uint32_t fmt_id; //big -- fmt
uint32_t fmt_sz; // 16 for PCM
uint16_t audio_format; //PCM =1
uint16_t num_channels; //Mono = 1; Sterep =2
uin