#include <sent/stddefs.h>
#include <sent/speech.h>
#include <sent/adin.h>
#include <sndfile.h>
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) |
Initialization: if listfile is specified, open it here. | |
boolean | adin_sndfile_begin () |
Begin reading audio data from a file. | |
int | adin_sndfile_read (SP16 *buf, int sampnum) |
Try to read sampnum samples and returns actual sample num recorded. | |
boolean | adin_sndfile_end () |
End recording. | |
char * | adin_sndfile_get_current_filename () |
A tiny function to get current input raw speech file name. | |
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. | |
static char | speechfilename [MAXPATHLEN] |
Buffer to hold input file name. |
Functions to get input from wave file using libsndfile library. Many file formats are supported, including Microsoft WAVE format, and RAW (no header) format, AU, SND, NIST and so on. The channel number should be 1 (monaural). On RAW file input, the data byte order must be in big endian.
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.
boolean adin_sndfile_standby | ( | int | freq, | |
void * | arg | |||
) |
Initialization: if listfile is specified, open it here.
Else, just store the required frequency.
freq | [in] required sampling frequency | |
arg | [in] file name of listfile, or NULL if not use |
Definition at line 202 of file adin_sndfile.c.
Referenced by adin_select().
boolean adin_sndfile_begin | ( | ) |
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().
int adin_sndfile_read | ( | SP16 * | buf, | |
int | sampnum | |||
) |
Try to read sampnum samples and returns actual sample num recorded.
buf | [out] samples obtained in this function | |
sampnum | [in] wanted number of samples to be read |
Definition at line 310 of file adin_sndfile.c.
Referenced by adin_select().
boolean adin_sndfile_end | ( | ) |
End recording.
Definition at line 331 of file adin_sndfile.c.
Referenced by adin_select().
char* adin_sndfile_get_current_filename | ( | ) |
A tiny function to get current input raw speech file name.
Definition at line 350 of file adin_sndfile.c.
Referenced by j_get_current_filename().