Julius 4.2
マクロ定義 | 関数 | 変数
libsent/src/anlz/wrwav.c

音声波形データを WAV ファイルに保存する [詳細]

#include <sent/stddefs.h>
#include <sent/speech.h>

ソースコードを見る。

マクロ定義

#define MYWRITE(A, B, C, D)   if (!mywrite(A, B, C, D)) {jlog("Error: wrwav: failed to write wave data\n"); fclose_writefile(fp); return NULL;}
 Function macro to mywrite() with error handling.

関数

static boolean mywrite (void *buf, size_t unitbyte, int unitnum, FILE *fp)
 Write speech data in little endian.
FILE * wrwav_open (char *filename, int sfreq)
 Open/create a WAVE file and write header.
boolean wrwav_data (FILE *fp, SP16 *buf, int len)
 Write speech samples.
boolean wrwav_close (FILE *fp)
 Close the file.

変数

static int totallen
 Total number of samples written to the file.

説明

音声波形データを WAV ファイルに保存する

作者:
Akinobu LEE
日付:
Tue Feb 15 01:02:18 2005
Revision:
1.3

wrwav.c で定義されています。


関数

static boolean mywrite ( void *  buf,
size_t  unitbyte,
int  unitnum,
FILE *  fp 
) [static]

Write speech data in little endian.

引数:
buf[in] speech data
unitbyte[in] unit size in bytes
unitnum[in] number of units to be written
fp[in] file pointer
戻り値:
TRUE on success (specified number of data has been written), FALSE on failure.

wrwav.c41 行で定義されています。

参照元 wrwav_close(), と wrwav_data().

FILE* wrwav_open ( char *  filename,
int  sfreq 
)

Open/create a WAVE file and write header.

Open or creat a new WAV file and prepare for later data writing. The frame length written here is dummy, and will be overwritten when closed by wrwav_close().

引数:
filename[in] file name
sfreq[in] sampling frequency of the data you are going to write
戻り値:
the file pointer.

wrwav.c74 行で定義されています。

参照元 record_sample_open().

boolean wrwav_data ( FILE *  fp,
SP16 buf,
int  len 
)

Write speech samples.

引数:
fp[in] file descriptor
buf[in] speech data to be written
len[in] length of above
戻り値:
actual number of written samples.

wrwav.c127 行で定義されています。

参照元 record_sample_write().

boolean wrwav_close ( FILE *  fp)

Close the file.

The frame length in the header part is overwritten by the actual value before file close.

引数:
fp[in] file pointer to close, previously opened by wrwav_open().
戻り値:
TRUE on success, FALSE on failure.

wrwav.c147 行で定義されています。

参照元 record_sample_close().