#include <sent/stddefs.h>
#include <sent/speech.h>
#include <sent/adin.h>
adin_file.cのインクルード依存関係図
マクロ定義 | |
#define | MYREAD(A, B, C, D) if (!myread(A, B, C, D)) {j_printerr("adin_file: file is corrupted\n"); return -1;} |
Abbreviation for header reading. | |
関数 | |
static boolean | myread (void *buf, size_t unitbyte, int unitnum, FILE *fp) |
static boolean | setup_wav (FILE *fp) |
Parse header part of a WAVE file to prepare for data reading. | |
static boolean | adin_file_open (char *filename) |
Open input file. | |
static boolean | adin_file_close () |
char * | get_line (char *prompt) |
boolean | adin_file_standby (int freq, void *arg) |
boolean | adin_file_begin () |
Begin reading audio data from a file. | |
int | adin_file_read (SP16 *buf, int sampnum) |
boolean | adin_file_end () |
boolean | adin_stdin_standby (int freq, void *arg) |
boolean | adin_stdin_begin () |
Begin reading audio data from stdin. | |
int | adin_stdin_read (SP16 *buf, int sampnum) |
変数 | |
static FILE * | gfp |
File pointer of current input file. | |
static boolean | wav_p |
TRUE if input is WAVE file, FALSE if RAW file. | |
static int | maxlen |
Number of samples, described in the header of WAVE file. | |
static int | nowlen |
Current number of read samples. | |
static SP16 | pre_data [2] |
static boolean | has_pre |
TRUE if pre_data is available. | |
static unsigned int | sfreq |
Sampling frequency in Hz, specified by adin_standby(). | |
static boolean | from_file |
TRUE if list file is used to read input filename. | |
static FILE * | fp_list |
File pointer used for the listfile. |
ファイルのサンプリングレートはシステムの要求するサンプリングレート (adin_standby() で指定される値)と一致する必要があります. WAVE形式のファイルの場合は, ファイルのサンプリングレートがこの指定値と一致しなければエラーとなります. RAWファイル入力の場合は,ファイルにヘッダ情報が無く録音時の サンプリングレートが不明なため,チェック無しでファイルの サンプリングレートが adin_standby() で指定された値である と仮定して処理されます.
入力ファイル名は,標準入力から読み込まれます. ファイル名を列挙したファイルリストファイルが指定された場合, そのファイルから入力ファイル名が順次読み込まれます.
libsndfile を使用する場合,adin_sndfile.c 内の関数が使用されます. この場合,このファイルの関数は使用されません.
このファイル内では int を 4byte, short を 2byte と仮定しています.
adin_file.c で定義されています。
|
Read a header value from WAVE file with endian conversion. If required number of data has not been read, it produces error.
adin_file.c の 102 行で定義されています。 参照元 CMN_load_from_file(), new_SS_load_from_file(), read_param(), と setup_wav(). |
|
Parse header part of a WAVE file to prepare for data reading. The audio format will be checked here, and data length is also read from the header. Then the pointer is moved to the start point of data part. When called, the file pointer should be located just after the first 4 bytes, "RIFF". It also sets maxlen and nowlen .
adin_file.c の 130 行で定義されています。 参照元 adin_file_open(). |
|
Open input file. Open the file, check the file format, and set the file pointer to gfp .
adin_file.c の 239 行で定義されています。 参照元 adin_file_begin(), と adin_stdin_begin(). |
|
Close the input file
adin_file.c の 288 行で定義されています。 参照元 adin_file_end(), と adin_file_read(). |
|
Get one file name from stdin with a prompt . Blank line is omitted.
adin_file.c の 314 行で定義されています。 参照元 adin_file_begin(), adin_sndfile_begin(), と main_recognition_loop(). |
|
Initialization: if listfile is specified, open it here.
adin_file.c の 355 行で定義されています。 参照元 adin_select(). |
|
Begin reading audio data from a file. If listfile was specified in adin_file_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.
adin_file.c の 385 行で定義されています。 参照元 adin_select(). |
|
Try to read sampnum samples and returns actual sample num recorded.
adin_file.c の 429 行で定義されています。 参照元 adin_select(). |
|
End recording.
adin_file.c の 476 行で定義されています。 参照元 adin_select(). |
|
Initialization for speech input via stdin.
adin_file.c の 492 行で定義されています。 参照元 adin_select(). |
|
Begin reading audio data from stdin.
adin_file.c の 505 行で定義されています。 参照元 adin_select(). |
|
Try to read sampnum samples and returns actual sample num recorded.
adin_file.c の 528 行で定義されています。 参照元 adin_select(). |
|
When file input, the first 4 bytes of the file are read at first to identify whether it is WAVE file format. This work area is used to keep back the 4 bytes if the input is actually a RAW format. adin_file.c の 82 行で定義されています。 参照元 adin_file_open(), adin_file_read(), と adin_stdin_read(). |