语音编码解码——speex。c代码ios和Android平台。

语音编码解码——speex。c代码ios和Android平台。,第1张

#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

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/993524.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-21
下一篇2022-05-21

发表评论

登录后才能评论

评论列表(0条)

    保存