#include <sent/stddefs.h>
#include <sent/speech.h>
Include dependency graph for wrwav.c:

Go to the source code of this file.
Defines | |
| #define | MYWRITE(A, B, C, D) if (!mywrite(A, B, C, D)) {j_printerr("wrwav_open: write failed\n"); fclose_writefile(fp); return NULL;} |
| Function macro to mywrite() with error handling. | |
Functions | |
| static boolean | mywrite (void *buf, size_t unitbyte, int unitnum, FILE *fp) |
| FILE * | wrwav_open (char *filename, int sfreq) |
| Open/create a WAVE file and write header. | |
| boolean | wrwav_data (FILE *fp, SP16 *buf, int len) |
| boolean | wrwav_close (FILE *fp) |
| Close the file. | |
Variables | |
| static int | totallen |
| Total number of samples written to the file. | |
Definition in 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 |
Definition at line 40 of file wrwav.c.
Referenced by CMN_save_to_file(), wrwav_close(), and 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 |
Definition at line 73 of file wrwav.c.
Referenced by record_sample_open().
Write speech samples.
| fp | [in] file descriptor | |
| buf | [in] speech data to be written | |
| len | [in] length of above |
Definition at line 126 of file wrwav.c.
Referenced by 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(). |
Definition at line 146 of file wrwav.c.
Referenced by record_sample_close().
1.5.0