main_livedecode.c File Reference

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

Defines

#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

Detailed Description

live-mode decoder demo.

Created by Yitao Sun (yitao@cs.cmu.edu). 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 (rkm@cs.cmu.edu) suggested using select() (and no threads) on the /dev/tty* device to remove Win32 dependency.


Define Documentation

#define BUFSIZE   4096

Referenced by process_thread().

#define cond_signal (  ) 
Value:
{                       \
        pthread_mutex_lock(&(c).mtx);           \
        (c).fired = 1;                          \
        pthread_cond_signal(&(c).cond);         \
        pthread_mutex_unlock(&(c).mtx);         \
}

Referenced by main().

#define COND_TIMEDOUT   ETIMEDOUT

Referenced by process_thread().

#define cond_wait (  ) 
Value:
{                               \
        pthread_mutex_lock(&(c).mtx);           \
        pthread_cond_wait(&(c).cond, &(c).mtx); \
        pthread_mutex_unlock(&(c).mtx);         \
}

Referenced by process_thread().

#define create_cond ( cc   ) 
Value:
{                       \
        pthread_cond_init(&(cc)->cond, NULL);   \
        pthread_mutex_init(&(cc)->mtx, NULL);   \
        (cc)->fired = 0;                        \
}

Referenced by main().

#define create_thread ( tt,
proc   )     pthread_create(tt, NULL, proc, NULL)

Referenced by main().

#define join_thread (  )     pthread_join(t, NULL)

Referenced by main().

#define THREAD_START   void *
#define TIMEOUT   100

Referenced by process_thread().


Typedef Documentation

typedef pthread_t mythread_t

Function Documentation

int cond_wait_timed ( condition_t c,
int  ticks 
)
int main ( int  argc,
char **  argv 
)
THREAD_START process_thread ( void *  aParam  ) 

Variable Documentation

FILE* dump = 0

Referenced by main(), and process_thread().

fe_t* fe

Referenced by main(), and process_thread().


Generated on 7 Mar 2010 by  doxygen 1.6.1