out_audio.c
来自「linux环境下用纯c写的RTP协议的通用开发库」· C语言 代码 · 共 43 行
C
43 行
#include "common.h"#include "decoder.h"#include "huffman.h"#define THRESHHOLD 16000 /* samples */void out_audio(audiodev, pcm_sample, num, fr_ps, psampFrames)int audiodev;short FAR pcm_sample[2][SSLIMIT][SBLIMIT];int num;frame_params *fr_ps;unsigned long *psampFrames;{ int i,j,l; int stereo; int sblimit; static short int outsamp16[THRESHHOLD]; static long k = 0; /* * Check for flush signal (num < 0). */ if (num < 0) { k = 0; return; } stereo = fr_ps->stereo; sblimit = fr_ps->sblimit; for (i=0;i<num;i++) for (j=0;j<SBLIMIT;j++) { (*psampFrames)++; for (l=0;l<stereo;l++) { outsamp16[k++] = pcm_sample[l][i][j]; if (k % THRESHHOLD == 0) { write(audiodev, outsamp16, k*2); k = 0; } } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?