lpctest.c

来自「IP网络语音通讯软件源代码. 不可多得的语音源代码」· C语言 代码 · 共 31 行

C
31
字号
#include <stdio.h>
#include "lpc.h"

/*#define ENCODE/**/
/*#define DECODE/**/

main(argc, argv)
  int argc;
  char **argv;
{
  int nbytes;
  unsigned char buf[180];
  lpcparams_t params;

fprintf(stderr, "S = %d\n", sizeof params);
  lpc_init(sizeof(buf));
#ifndef DECODE
  while ((nbytes = read(0, buf, sizeof(buf))) > 0) {
	lpc_analyze(buf, &params);
#else
  while ((nbytes = read(0, &params, sizeof(params))) > 0) {
#endif
#ifdef ENCODE
	write(1, &params, sizeof params);
#else
	nbytes = lpc_synthesize(&params, 1.0, buf);
	write(1, buf, nbytes);
#endif
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?