#include <sent/stddefs.h>
#include <sent/speech.h>
#include <sent/adin.h>
#include <sndfile.h>
Include dependency graph for adin_sndfile.c:
Go to the source code of this file.
Functions | |
static boolean | check_format (SF_INFO *s) |
Check if the file format is 16bit, monoral. | |
static void | print_format (SF_INFO *s) |
Output format information to stdout (compliant to libsnd-0.0.23). | |
boolean | adin_sndfile_standby (int freq, void *arg) |
boolean | adin_sndfile_begin () |
Begin reading audio data from a file. | |
int | adin_sndfile_read (SP16 *buf, int sampnum) |
boolean | adin_sndfile_end () |
Variables | |
static int | sfreq |
Required sampling frequency in Hz. | |
static SF_INFO | sinfo |
Wavefile information. | |
static SNDFILE * | sp |
File handler. | |
static boolean | from_file |
TRUE if reading filename from listfile. | |
static FILE * | fp_list |
File pointer used for the listfile. |
The sampling rate of input file must be equal to the system requirement value which is specified by adin_standby() . For WAVE format file, the sampling rate of the input file described in its header is checked against the system value, and rejected if not matched. But for RAW format file, no check will be applied since it has no header information about the recording sampling rate, so be careful of the sampling rate setting.
When file input mode, the file name will be read from standard input. If a filelist file is specified, the file names are read from the file sequencially instead.
libsndfile should be installed before compilation. The library and header will be automatically detected by configure script. When failed to detect, Julius uses adin_file.c instead for file input.
This file will work on libsndfile version 1.0.x.
Definition in file adin_sndfile.c.
|
Initialization: if listfile is specified, open it here. Else, just store the required frequency.
Definition at line 202 of file adin_sndfile.c. Referenced by adin_select(). |
|
Begin reading audio data from a file. If listfile was specified in adin_sndfile_standby(), the next filename will be read from the listfile. Otherwise, the filename will be obtained from stdin. Then the file will be opened here.
Definition at line 232 of file adin_sndfile.c. Referenced by adin_select(). |
|
Try to read sampnum samples and returns actual sample num recorded.
Definition at line 313 of file adin_sndfile.c. Referenced by adin_select(). |
|
End recording.
Definition at line 334 of file adin_sndfile.c. Referenced by adin_select(). |