#include <sent/stddefs.h>
#include <sent/speech.h>
Include dependency graph for adin.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | DEFAULT_WSTEP 1000 |
Default unit size of speech input segment in bytes. | |
#define | SUPPORTED_WAVEFILE_FORMAT "RAW(BE),WAV,AU,SND,NIST,ADPCM and more" |
#define | ZMEANSAMPLES 48000 |
Enumerations | |
enum | { SP_RAWFILE, SP_MIC, SP_ADINNET, SP_MFCFILE, SP_NETAUDIO, SP_STDIN } |
To select speech input source. More... | |
Functions | |
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_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 () |
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. |
Definition in file adin.h.
|
String describing the list of supported wave file formats. It depends on HAVE_LIBSNDFILE. Definition at line 55 of file adin.h. Referenced by detailed_help(). |
|
Number of samples from beggining of input to be used for computing the zero mean of source channel (for microphone/network input). Definition at line 65 of file adin.h. Referenced by print_info(), and sub_zmean(). |
|
To select speech input source.
|
|
Select input source and setup device-specific functions.
Definition at line 134 of file adin.c. Referenced by adin_initialize(). |
|
Call device-specific initialization.
Definition at line 227 of file adin.c. Referenced by adin_initialize(). |
|
Call device-specific function to begin capturing of the audio stream.
Definition at line 239 of file adin.c. Referenced by main_recognition_loop(). |
|
Call device-specific function to end capturing of the audio stream.
Definition at line 251 of file adin.c. Referenced by main_recognition_loop(). |
|
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().
Definition at line 178 of file adin-cut.c. Referenced by adin_register_func(). |
|
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.
Definition at line 215 of file adin-cut.c. Referenced by adin_initialize(). |
|
Query function to check whether the input speech detection is on or off.
Definition at line 253 of file adin-cut.c. Referenced by print_info(). |
|
Query function to check whether the input threading is on or off.
Definition at line 264 of file adin-cut.c. Referenced by print_info(). |
|
Reset zero mean data to re-estimate zero mean at the next input. Definition at line 274 of file adin-cut.c. Referenced by adin_begin(), and adin_standby(). |
|
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.
Definition at line 1123 of file adin-cut.c. Referenced by main_recognition_loop(). |
|
Device initialization: check device capability and open for recording.
Definition at line 51 of file adin_esd.c. Referenced by adin_select(). |
|
Start recording.
Definition at line 75 of file adin_esd.c. Referenced by adin_mic_standby(), and adin_select(). |
|
Stop recording.
Definition at line 86 of file adin_esd.c. Referenced by adin_mic_standby(), and adin_select(). |
|
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.
Definition at line 104 of file adin_esd.c. Referenced by adin_select(). |
|
Connection initialization: check connectivity and open for recording.
Definition at line 57 of file adin_netaudio.c. Referenced by adin_select(). |
|
Start recording.
Definition at line 71 of file adin_netaudio.c. Referenced by adin_select(). |
|
Stop recording.
Definition at line 84 of file adin_netaudio.c. Referenced by adin_select(). |
|
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.
Definition at line 103 of file adin_netaudio.c. Referenced by adin_select(). |
|
Initialize NetAudio device.
Definition at line 59 of file adin_na.c. Referenced by adin_netaudio_standby(). |
|
Begin recording. Definition at line 128 of file adin_na.c. Referenced by adin_netaudio_start(). |
|
Pause the recording. Definition at line 138 of file adin_na.c. Referenced by adin_netaudio_stop(). |
|
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.
Definition at line 156 of file adin_na.c. Referenced by adin_netaudio_read(). |
|
Get one file name from stdin with a prompt . Blank line is omitted.
Definition at line 314 of file adin_file.c. Referenced by adin_file_begin(), adin_sndfile_begin(), and main_recognition_loop(). |
|
Initialization: if listfile is specified, open it here.
Definition at line 355 of file adin_file.c. Referenced by 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.
Definition at line 385 of file adin_file.c. Referenced by adin_select(). |
|
Try to read sampnum samples and returns actual sample num recorded.
Definition at line 429 of file adin_file.c. Referenced by adin_select(). |
|
End recording.
Definition at line 476 of file adin_file.c. Referenced by adin_select(). |
|
Initialization for speech input via stdin.
Definition at line 492 of file adin_file.c. Referenced by adin_select(). |
|
Begin reading audio data from stdin.
Definition at line 505 of file adin_file.c. Referenced by adin_select(). |
|
Try to read sampnum samples and returns actual sample num recorded.
Definition at line 528 of file adin_file.c. Referenced by adin_select(). |
|
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(). |
|
Initialize as adinnet server: prepare to become server.
Definition at line 78 of file adin_tcpip.c. Referenced by adin_select(). |
|
Wait for connection from adinnet client and begin audio input stream.
Definition at line 100 of file adin_tcpip.c. Referenced by adin_select(). |
|
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.
Definition at line 146 of file adin_tcpip.c. Referenced by adin_select(). |
|
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.
Definition at line 177 of file adin_tcpip.c. Referenced by adin_select(). |
|
Tell the adinnet client to pause transfer.
Definition at line 223 of file adin_tcpip.c. |
|
Tell the adinnet client to terminate transfer.
Definition at line 257 of file adin_tcpip.c. |
|
Tell the adinnet client to resume the paused transfer.
Definition at line 240 of file adin_tcpip.c. |
|
Initialize all parameters and buffers for zero-cross counting.
Definition at line 63 of file zc-e.c. Referenced by adin_cut(). |
|
End procedure: free all buffers. Definition at line 91 of file zc-e.c. Referenced by adin_cut(). |
|
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.
Definition at line 107 of file zc-e.c. Referenced by adin_cut(). |
|
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.
|
|
Flush samples in the current cycle buffer.
Definition at line 205 of file zc-e.c. Referenced by adin_cut(). |
|
Reset status. Definition at line 50 of file zmean.c. Referenced by adin_reset_zmean(). |
|
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.
Definition at line 69 of file zmean.c. Referenced by adin_cut(). |