#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. | |
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 |
参照元 CMN_save_to_file(), 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 |
参照元 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 |
| 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(). |
1.5.4