wrsamp.c

来自「julius version 4.12.about sound recognit」· C语言 代码 · 共 51 行

C
51
字号
/** * @file   wrsamp.c * * <JA> * @brief  不兰侨妨误を big endian のバイトオ〖ダ〖で今き哈む * </JA> * <EN> * @brief  Write waveform data in big endian * </EN> * * @author Akinobu LEE * @date   Tue Feb 15 00:58:47 2005 * * $Revision: 1.2 $ *  *//* * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology * Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology * All rights reserved */#include <sent/stddefs.h>#include <sent/speech.h>/**  * Write waveform data in big endian to a file descriptor *  * @param fd [in] file descriptor * @param buf [in] array of speech data * @param len [in] length of above *  * @return number of bytes written, -1 on error. */intwrsamp(int fd, SP16 *buf, int len){  int ret;#ifndef WORDS_BIGENDIAN  /* swap byte order to BIG ENDIAN */  swap_sample_bytes(buf, len);#endif  ret = write(fd, buf, len * sizeof(SP16));#ifndef WORDS_BIGENDIAN  /* undo byte swap */  swap_sample_bytes(buf, len);#endif  return(ret);}

⌨️ 快捷键说明

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