libsent/include/sent/adin.h

音声入力および音声区間検出に関する定義 [詳細]

#include <sent/stddefs.h>
#include <sent/speech.h>
adin.hのインクルード依存関係図
このグラフは、どのファイルから直接、間接的にインクルードされているかを示しています。

ソースコードを見る。

マクロ定義

#define DEFAULT_WSTEP   1000
 Default unit size of speech input segment in bytes.
#define SUPPORTED_WAVEFILE_FORMAT   "RAW(BE),WAV"
#define ZMEANSAMPLES   48000

列挙型

enum  {
  SP_RAWFILE, SP_MIC, SP_ADINNET, SP_MFCFILE,
  SP_NETAUDIO, SP_STDIN
}
 

To select speech input source.

[詳細]

関数

boolean adin_select (int source)
boolean adin_standby (int freq, void *arg)
boolean adin_begin ()
boolean adin_end ()
void adin_setup_func (int(*cad_read)(SP16 *, int), boolean(*cad_pause)(), boolean(*cad_resume)(), boolean use_cut_def, boolean need_thread)
void adin_setup_param (int silence_cut, boolean strip_zero, int cthres, int czc, int margin, int tail_margin, int sample_freq, boolean ignore_speech, boolean need_zeromean)
boolean query_segment_on ()
boolean query_thread_on ()
void adin_reset_zmean ()
int adin_go (int(*ad_process)(SP16 *, int), int(*ad_check)())
 Top function to start input processing.
boolean adin_mic_standby (int freq, void *arg)
boolean adin_mic_start ()
boolean adin_mic_stop ()
int adin_mic_read (SP16 *buf, int sampnum)
 Read samples from the daemon.
boolean adin_netaudio_standby (int freq, void *arg)
boolean adin_netaudio_start ()
boolean adin_netaudio_stop ()
int adin_netaudio_read (SP16 *buf, int sampnum)
 Read samples from the daemon.
int NA_standby (int, char *)
void NA_start ()
void NA_stop ()
int NA_read (SP16 *buf, int sampnum)
 Read samples from NetAudio port.
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)
boolean adin_tcpip_standby (int freq, void *arg)
boolean adin_tcpip_begin ()
boolean adin_tcpip_end ()
 End recording.
int adin_tcpip_read (SP16 *buf, int sampnum)
boolean adin_tcpip_send_pause ()
boolean adin_tcpip_send_terminate ()
boolean adin_tcpip_send_resume ()
void init_count_zc_e (int c_trigger, int c_length, int c_offset)
void end_count_zc_e ()
int count_zc_e (SP16 *buf, int step)
int count_zc_e_level (SP16 *buf, int step, int *levelp)
void zc_copy_buffer (SP16 *newbuf, int *len)
void zmean_reset ()
void sub_zmean (SP16 *speech, int samplenum)
 Remove DC offset.

説明

音声入力および音声区間検出に関する定義

作者:
Akinobu LEE
日付:
Thu Feb 10 17:22:36 2005

このファイルには, さまざまなソースからの音声入力処理と音声区間の検出 に関連するいくつかの定義が含まれています.

参照:
speech.h
Revision
1.4

adin.h で定義されています。


マクロ定義

#define SUPPORTED_WAVEFILE_FORMAT   "RAW(BE),WAV"

String describing the list of supported wave file formats. It depends on HAVE_LIBSNDFILE.

adin.h57 行で定義されています。

参照元 detailed_help().

#define ZMEANSAMPLES   48000

Number of samples from beggining of input to be used for computing the zero mean of source channel (for microphone/network input).

adin.h65 行で定義されています。

参照元 print_info(), と sub_zmean().


列挙型

anonymous enum

To select speech input source.

列挙型の値:
SP_RAWFILE 

Wavefile.

SP_MIC 

Live microphone device.

SP_ADINNET 

Network client (adintool etc.).

SP_MFCFILE 

HTK parameter file.

SP_NETAUDIO 

Live NetAudio/DatLink input.

SP_STDIN 

Standard input.

adin.h37 行で定義されています。


関数

boolean adin_select ( int  source  ) 

Select input source and setup device-specific functions.

引数:
source [In] selection ID of input source
参照:
adin.h
戻り値:
TRUE on success, FALSE if source is not available.

adin.c134 行で定義されています。

参照元 adin_initialize().

boolean adin_standby ( int  freq,
void *  arg 
)

Call device-specific initialization.

引数:
freq [in] sampling frequency
arg [in] device-dependent extra argument
戻り値:
TRUE on success, FALSE on failure.

adin.c227 行で定義されています。

参照元 adin_initialize().

boolean adin_begin (  ) 

Call device-specific function to begin capturing of the audio stream.

戻り値:
TRUE on success, FALSE on failure.

adin.c239 行で定義されています。

参照元 main_recognition_loop().

boolean adin_end (  ) 

Call device-specific function to end capturing of the audio stream.

戻り値:
TRUE on success, FALSE on failure.

adin.c251 行で定義されています。

参照元 main_recognition_loop().

void adin_setup_func ( int(*)(SP16 *, int)  cad_read,
boolean(*)()  cad_pause,
boolean(*)()  cad_resume,
boolean  use_cut_def,
boolean  need_thread 
)

Store the given device-dependent functions and configuration values to local work area. This function will be called from adin_select() via adin_register_func().

引数:
[in] cad_read function to read input samples
[in] cad_pause function to stop input
[in] cad_resume function to (re-)start input
[in] use_cut_def TRUE if the device needs speech segment detection by default
[in] need_thread TRUE if the device is live input and needs threading

adin-cut.c179 行で定義されています。

参照元 adin_register_func().

void adin_setup_param ( int  silence_cut,
boolean  strip_zero,
int  cthres,
int  czc,
int  head_margin,
int  tail_margin,
int  sample_freq,
boolean  ignore_speech,
boolean  need_zeromean 
)

Setup silence detection parameters (should be called after adin_select()). If using pthread, the A/D-in and detection thread will be started at the end of this function.

引数:
silence_cut [in] whether to perform silence cutting. 0=force off, 1=force on, 2=keep device-specific default
strip_zero [in] TRUE if enables stripping of zero samples
cthres [in] input level threshold (0-32767)
czc [in] zero-cross count threshold in a second
head_margin [in] header margin length in msec
tail_margin [in] tail margin length in msec
sample_freq [in] sampling frequency: just providing value for computing other variables
ignore_speech [in] TRUE if ignore speech input between call, while waiting recognition process
need_zeromean [in] TRUE if perform zero-mean subtraction

adin-cut.c216 行で定義されています。

参照元 adin_initialize().

boolean query_segment_on (  ) 

Query function to check whether the input speech detection is on or off.

戻り値:
TRUE if on, FALSE if off.

adin-cut.c254 行で定義されています。

参照元 print_info().

boolean query_thread_on (  ) 

Query function to check whether the input threading is on or off.

戻り値:
TRUE if on, FALSE if off.

adin-cut.c265 行で定義されています。

参照元 print_info().

void adin_reset_zmean (  ) 

Reset zero mean data to re-estimate zero mean at the next input.

adin-cut.c275 行で定義されています。

参照元 adin_begin(), と adin_standby().

int adin_go ( int(*)(SP16 *, int)  ad_process,
int(*)()  ad_check 
)

Top function to start input processing.

If threading mode is enabled, this function simply enters to adin_thread_process() to process triggered samples detected by another running A/D-in thread.

If threading mode is not available or disabled by either device requirement or OS capability, this function simply calls adin_cut() to detect speech segment from input device and process them concurrently by one process.

引数:
ad_process [in] function to process the recorded fragments
ad_check [in] function to be called periodically for checking incoming user command in module mode.
戻り値:
the same as adin_thread_process() in threading mode, or same as adin_cut() when non-threaded mode.

adin-cut.c1126 行で定義されています。

参照元 main_recognition_loop().

boolean adin_mic_standby ( int  sfreq,
void *  dummy 
)

Connection initialization: check connectivity and open for recording.

引数:
sfreq [in] required sampling frequency
dummy [in] a dummy data
戻り値:
TRUE on success, FALSE on failure.

Device initialization: check device capability and open for recording.

引数:
sfreq [in] required sampling frequency.
arg [in] a dummy data
戻り値:
TRUE on success, FALSE on failure.

Device initialization: check device capability and open for recording.

引数:
sfreq [in] required sampling frequency.
dummy [in] a dummy data
戻り値:
TRUE on success, FALSE on failure.

adin_esd.c51 行で定義されています。

参照元 adin_select().

boolean adin_mic_start (  ) 

Start recording.

戻り値:
TRUE on success, FALSE on failure.

adin_esd.c75 行で定義されています。

参照元 adin_mic_standby(), と adin_select().

boolean adin_mic_stop (  ) 

Stop recording.

戻り値:
TRUE on success, FALSE on failure.

adin_esd.c86 行で定義されています。

参照元 adin_mic_standby(), と adin_select().

int adin_mic_read ( SP16 buf,
int  sampnum 
)

Read samples from the daemon.

Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block until at least one sample can be obtained.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, -2 if an error occured.

Read samples from the daemon.

Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block until at least one sample can be obtained.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, -2 if error.

Read samples from the daemon.

Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block until at least one sample can be obtained.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, -2 if an error occured.

Read samples from the daemon.

Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block at most MAXPOLLINTERVAL msec, until at least one sample can be obtained. If no data has been obtained after waiting for MAXPOLLINTERVAL msec, returns 0.

When stereo input, only left channel will be used.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, 0 of no sample has been captured in MAXPOLLINTERVAL msec, -2 if error.

Read samples from the daemon.

Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block until at least some samples are obtained.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, -2 if an error occured.

adin_esd.c104 行で定義されています。

参照元 adin_select().

boolean adin_netaudio_standby ( int  sfreq,
void *  arg 
)

Connection initialization: check connectivity and open for recording.

引数:
sfreq [in] required sampling frequency
arg [in] server device name string to connect
戻り値:
TRUE on success, FALSE on failure.

adin_netaudio.c57 行で定義されています。

参照元 adin_select().

boolean adin_netaudio_start (  ) 

Start recording.

戻り値:
TRUE on success, FALSE on failure.

adin_netaudio.c71 行で定義されています。

参照元 adin_select().

boolean adin_netaudio_stop (  ) 

Stop recording.

戻り値:
TRUE on success, FALSE on failure.

adin_netaudio.c84 行で定義されています。

参照元 adin_select().

int adin_netaudio_read ( SP16 buf,
int  sampnum 
)

Read samples from the daemon.

Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block until at least one sample can be obtained.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, -2 if an error occured.

adin_netaudio.c103 行で定義されています。

参照元 adin_select().

int NA_standby ( int  sfreq,
char *  server_devname 
)

Initialize NetAudio device.

引数:
sfreq [in] sampling frequency
server_devname [in] server host name
戻り値:
1 on success, 0 on failure.

adin_na.c59 行で定義されています。

参照元 adin_netaudio_standby().

void NA_start (  ) 

Begin recording.

adin_na.c128 行で定義されています。

参照元 adin_netaudio_start().

void NA_stop (  ) 

Pause the recording.

adin_na.c138 行で定義されています。

参照元 adin_netaudio_stop().

int NA_read ( SP16 buf,
int  sampnum 
)

Read samples from NetAudio port.

Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block until at least some samples are obtained.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, -1 if an error occured.

adin_na.c156 行で定義されています。

参照元 adin_netaudio_read().

char* get_line ( char *  prompt  ) 

Get one file name from stdin with a prompt . Blank line is omitted.

引数:
prompt [in] prompt string
戻り値:
newly allocated buffer filled with the input.

adin_file.c314 行で定義されています。

参照元 adin_file_begin(), adin_sndfile_begin(), と main_recognition_loop().

boolean adin_file_standby ( int  freq,
void *  arg 
)

Initialization: if listfile is specified, open it here.

引数:
freq [in] required sampling frequency.
arg [in] file name of listfile, or NULL if not use
戻り値:
TRUE on success, FALSE on failure.

adin_file.c355 行で定義されています。

参照元 adin_select().

boolean adin_file_begin (  ) 

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.

戻り値:
TRUE on success, FALSE on failure.

adin_file.c385 行で定義されています。

参照元 adin_select().

int adin_file_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
戻り値:
actural number of read samples, -1 if EOF, -2 if error.

adin_file.c429 行で定義されています。

参照元 adin_select().

boolean adin_file_end (  ) 

End recording.

戻り値:
TRUE on success, FALSE on failure.

adin_file.c476 行で定義されています。

参照元 adin_select().

boolean adin_stdin_standby ( int  freq,
void *  arg 
)

Initialization for speech input via stdin.

引数:
freq [in] required sampling frequency.
arg dummy, ignored
戻り値:
TRUE on success, FALSE on failure.

adin_file.c492 行で定義されています。

参照元 adin_select().

boolean adin_stdin_begin (  ) 

Begin reading audio data from stdin.

戻り値:
TRUE on success, FALSE on failure.

adin_file.c505 行で定義されています。

参照元 adin_select().

int adin_stdin_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
戻り値:
actural number of read samples, -1 if EOF, -2 if error.

adin_file.c528 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_standby ( int  freq,
void *  port_str 
)

Initialize as adinnet server: prepare to become server.

引数:
freq [in] required sampling frequency
port_str [in] port number in string
戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c78 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_begin (  ) 

Wait for connection from adinnet client and begin audio input stream.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c100 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_end (  ) 

End recording.

If last input segment was segmented by end of connection, close socket and wait for next connection. Otherwise, it means that the last input segment was segmented by either end-of-segment signal from client side or speech detection function in server side, so just wait for a next input in the current socket.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c146 行で定義されています。

参照元 adin_select().

int adin_tcpip_read ( SP16 buf,
int  sampnum 
)

Try to read sampnum samples and returns actual sample num recorded. This function will not block.

If data of zero length has been received, it is treated as a end-of-segment marker from the client. If data below zero length has been received, it means the client has finished the overall input stream transmission and want to disconnect.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, -1 if EOF, -2 if error.

adin_tcpip.c177 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_send_pause (  ) 

Tell the adinnet client to pause transfer.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c223 行で定義されています。

参照元 msock_exec_command().

boolean adin_tcpip_send_terminate (  ) 

Tell the adinnet client to terminate transfer.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c257 行で定義されています。

参照元 msock_exec_command().

boolean adin_tcpip_send_resume (  ) 

Tell the adinnet client to resume the paused transfer.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c240 行で定義されています。

参照元 msock_exec_command().

void init_count_zc_e ( int  c_trigger,
int  c_length,
int  c_offset 
)

Initialize all parameters and buffers for zero-cross counting.

引数:
c_trigger [in] Tgigger level threshold
c_length [in] Cycle buffer size = Number of samples to hold
c_offset [in] Static DC offset of input data

zc-e.c63 行で定義されています。

参照元 adin_cut().

void end_count_zc_e (  ) 

End procedure: free all buffers.

zc-e.c91 行で定義されています。

参照元 adin_cut().

int count_zc_e ( SP16 buf,
int  step 
)

Adding buf[0..step-1] to the cycle buffer and update the count of zero cross. Also swap them with the oldest ones in the cycle buffer.

引数:
buf [I/O] new samples given, and swapped samples will be returned.
step [in] length of above.
戻り値:
zero-cross count of the samples in the cycle buffer.

zc-e.c107 行で定義されています。

参照元 adin_cut().

int count_zc_e_level ( SP16 buf,
int  step,
int *  levelp 
)

Adding buf[0..step-1] to the cycle buffer and update the count of zero cross. Also swap them with the oldest ones in the cycle buffer. Also get the maximum level in the cycle buffer.

引数:
buf [I/O] new samples, will be swapped by old samples when returned.
step [in] length of above.
levelp [out] maximum level in the cycle buffer.
戻り値:
zero-cross count of the samples in the cycle buffer.

zc-e.c157 行で定義されています。

void zc_copy_buffer ( SP16 newbuf,
int *  len 
)

Flush samples in the current cycle buffer.

引数:
newbuf [out] the samples in teh cycle buffer will be written here.
len [out] length of above.

zc-e.c205 行で定義されています。

参照元 adin_cut().

void zmean_reset (  ) 

Reset status.

zmean.c50 行で定義されています。

参照元 adin_reset_zmean().

void sub_zmean ( SP16 speech,
int  samplenum 
)

Remove DC offset.

The DC offset is estimated by the first samples after zmean_reset() was called. If the first input segment is longer than ZMEANSAMPLES, the whole input is used to estimate the zero mean. Otherwise, the zero mean will continue to be updated until the read length exceed ZMEANSAMPLES.

引数:
speech [I/O] input speech data, will be subtracted by DC offset.
samplenum [in] length of above.

zmean.c69 行で定義されています。

参照元 adin_cut().


Juliusに対してTue Sep 22 00:14:34 2009に生成されました。  doxygen 1.6.0