speech codec (G.711, G.723, G.726, G.729, iLBC)

 

http://www.cnblogs.com/huaping-audio/archive/2008/06/19/1224287.html

 

实际带宽

=包长度×每秒包数
=包长度×(1/打包周期)
=(Ethernet头+IP头+UDP头+RTP头+有效载荷)×(1/打包周期)
=(208bit +160bit+64bit+96bit +有效载荷)×(1/打包周期)
=(528bit+(打包周期(秒)×每秒的比特数))×(1/打包周期)
=( 528 / 打包周期 ) + 每秒比特数


按照上面的计算公式:
G711:20ms打包,带宽为 ( 528/20 + 64) Kbit/s=90.4 Kbit/s
G729:20ms打包,带宽为 ( 528/20 + 8 ) Kbit/s= 34.4 Kbit/s
G723:5.3k,30ms打包,带宽为 ( 528/30 + 5.3 ) Kbit/s=22.9 Kbit/s
业界一般按照下表提供的IP网带宽系数和以太网带宽系数来设计网络带宽 

编解码技术压缩速率(Kbps)打包周期(ms)IP网带宽系数以太网带宽系数
G.711 a/u

64

20

1.25

1.41

G.729 a/b

8

20

0.38

0.54

G.723.1(5.3kbit/s)

5.3

30

0.27

0.37

G.723.1(6.3Kbit/s)

6.3

30

0.25

0.36


注:采用某种编码方式时,用64K乘以相应的 带宽 系数就可以得出其实际占用的 带宽 。当然如果是中继接口,还需要考虑信令占据一定的 带宽 ,一般按照2.5%来计算。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
iLBC (internet Low Bitrate Codec) is a speech codec used for encoding and decoding speech signals. To decode an iLBC-encoded audio file, you can use a decoder library or tool that supports iLBC decoding. Here is an example of how you can decode an iLBC file using the libilbc library in C: 1. Install the libilbc library on your system. 2. Include the necessary header files in your C code: ```c #include <stdio.h> #include <stdlib.h> #include <ilbc/ilbc.h> ``` 3. Write a function to perform the iLBC decoding: ```c void ilbc_decode(const char* input_file, const char* output_file) { FILE* fin = fopen(input_file, "rb"); FILE* fout = fopen(output_file, "wb"); // Get input file size fseek(fin, 0, SEEK_END); long input_size = ftell(fin); rewind(fin); // Allocate memory for input and output buffers int16_t* input_buffer = (int16_t*)malloc(input_size); int16_t* output_buffer = (int16_t*)malloc(input_size * 2); // Double the size for stereo audio // Read the input file into the input buffer fread(input_buffer, sizeof(int16_t), input_size / sizeof(int16_t), fin); // Create an iLBC decoder instance iLBC_Dec_Inst_t* dec_inst = iLBC_create(1); // 1 for 20ms frame size // Perform the decoding int num_frames = input_size / (2 * sizeof(int16_t)); // Assuming mono audio, 2 bytes per sample iLBC_decode(dec_inst, input_buffer, num_frames, output_buffer); // Write the decoded audio to the output file fwrite(output_buffer, sizeof(int16_t), num_frames * sizeof(int16_t), fout); // Cleanup fclose(fin); fclose(fout); free(input_buffer); free(output_buffer); iLBC_free(dec_inst); } ``` 4. Call the `ilbc_decode` function with the input and output file paths: ```c int main() { const char* input_file = "encoded.ilbc"; const char* output_file = "decoded.pcm"; ilbc_decode(input_file, output_file); return 0; } ``` Make sure to replace "encoded.ilbc" with the path to your iLBC-encoded file and "decoded.pcm" with the desired output file path. After running the program, you should have the decoded audio in the output file. Please note that this is just a basic example, and you may need to modify it according to your specific requirements and the iLBC decoder library you are using.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值