#include <sent/stddefs.h>
#include <sent/speech.h>
#include <sent/adin.h>
#include <sndfile.h>
関数 | |
| 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. | |
変数 | |
| 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 | |
libsndfile を用いて音声ファイルからの入力を行なう関数です. Microsoft WAVE形式の音声ファイル,およびヘッダ無し(RAW)ファイルの他に, AU, AND, NIST, ADPCM など様々な形式のファイルを読み込むことができます. なお,チャンネル数は1(モノラル)に限られます.またRAWファイルの場合, データのバイトオーダーは big endian である必要があります.
ファイルのサンプリングレートはシステムの要求するサンプリングレート (adin_standby() で指定される値)と一致する必要があります. ファイルのサンプリングレートがこの指定値と一致しなければエラーとなります. RAWファイル入力の場合は,ファイルにヘッダ情報が無く録音時の サンプリングレートが不明なため,チェック無しでファイルの サンプリングレートが adin_standby() で指定された値である と仮定して処理されます.
入力ファイル名は,標準入力から読み込まれます. ファイル名を列挙したファイルリストファイルが指定された場合, そのファイルから入力ファイル名が順次読み込まれます.
libsndfile はconfigure 時に自動検出されます.検出に失敗した場合, ファイル入力には adin_file.c 内の関数が使用されます.
Libsndfile のバージョンは 1.0.x に対応しています.
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 |
adin_sndfile.c の 202 行で定義されています。
参照元 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.
adin_sndfile.c の 232 行で定義されています。
参照元 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 |
adin_sndfile.c の 310 行で定義されています。
参照元 adin_select().
| boolean adin_sndfile_end | ( | ) |
End recording.
adin_sndfile.c の 331 行で定義されています。
参照元 adin_select().
| char* adin_sndfile_get_current_filename | ( | ) |
A tiny function to get current input raw speech file name.
adin_sndfile.c の 350 行で定義されています。
1.5.1