
#include //是预处理器指令,告诉 C 编译器在实际编译之前要包含 stdio.h 文件。
#include
#include
#include
#include
#define ENCODE 1
#define PROJECT_PATH "SpeexCode"
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
#define IN_PCM(a) strcat(a,"/file/input.pcm")
#define OUT_SPX(a) strcat(a,"/file/out.spx")
#define OUT_PCM(a) strcat(a,"/file/out.pcm")
// 编码 inputLen 输入长度
void encode(char* IN_PCM,char* OUT_SPX,int mode,int quality,int dataLen,int bufferLen)
{
// char *inFile;
// FILE *fin;
FILE *fin = NULL, *fout = NULL;
short in[dataLen/2];
char cbits[200];
int nbBytes;
/*Holds the state of the encoder*/
void *ptr_state;
/*Holds bits so they can be read and written to by the Speex routines*/
// SpeexBits ptr_bits;
SpeexBits ptr_bits;
// SpeexBits *ptr_bits = new SpeexBits;
int i, tmp;
/*Create a new encoder state in narrowban 欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)