live-mode decoder demo. More...
#include <sys/stat.h>
#include <fcntl.h>
#include <s3_decode.h>
#include <ad.h>
#include <stdio.h>
#include <pthread.h>
#include <sys/time.h>
#include <time.h>
Classes | |
struct | condition_t |
Macros | |
#define | BUFSIZE 4096 |
#define | TIMEOUT 100 |
#define | THREAD_START void * |
#define | COND_TIMEDOUT ETIMEDOUT |
#define | cond_wait(c) |
#define | cond_signal(c) |
#define | create_cond(cc) |
#define | create_thread(tt, proc) pthread_create(tt, NULL, proc, NULL) |
#define | join_thread(t) pthread_join(t, NULL) |
Typedefs | |
typedef pthread_t | mythread_t |
Functions | |
int | cond_wait_timed (condition_t *c, int ticks) |
THREAD_START | process_thread (void *aParam) |
int | main (int argc, char **argv) |
Variables | |
condition_t | startEvent |
condition_t | finishEvent |
fe_t * | fe |
s3_decode_t | decoder |
FILE * | dump = 0 |
live-mode decoder demo.
Created by Yitao Sun (yitao). This is a test program written for the Win32 platform. The program initializes Sphinx3 live-decode API, then in a press-to-start and press-to-stop fashion, records and decodes a session of user speech. The threading and synchronization code are Win32- specific. Ravi Mosur ( @cs. cmu.e durkm@c) suggested using select() (and no threads) on the /dev/tty* device to remove Win32 dependency. s.cm u.edu
#define BUFSIZE 4096 |
Referenced by process_thread().
#define cond_signal | ( | c | ) |
#define COND_TIMEDOUT ETIMEDOUT |
Referenced by process_thread().
#define cond_wait | ( | c | ) |
Referenced by process_thread().
#define create_cond | ( | cc | ) |
#define create_thread | ( | tt, | |
proc | |||
) | pthread_create(tt, NULL, proc, NULL) |
#define join_thread | ( | t | ) | pthread_join(t, NULL) |
#define THREAD_START void * |
#define TIMEOUT 100 |
Referenced by process_thread().
typedef pthread_t mythread_t |
int cond_wait_timed | ( | condition_t * | c, |
int | ticks | ||
) |
References condition_t::cond, condition_t::fired, and condition_t::mtx.
Referenced by process_thread().
int main | ( | int | argc, |
char ** | argv | ||
) |
initializing a file to dump the recorded audio
THREAD_START process_thread | ( | void * | aParam | ) |
dump the recorded audio to disk
References BUFSIZE, COND_TIMEDOUT, cond_wait, cond_wait_timed(), kbcore_t::config, decoder, dump, fe, finishEvent, s3_decode_t::kbcore, s3_decode_end_utt(), s3_decode_hypothesis(), s3_decode_process(), startEvent, and TIMEOUT.
s3_decode_t decoder |
Referenced by process_thread().
FILE* dump = 0 |
Referenced by process_thread().
fe_t* fe |
Referenced by process_thread().
condition_t finishEvent |
Referenced by process_thread().
condition_t startEvent |
Referenced by process_thread().