julius/record.c File Reference

Record speech inputs into successive files. More...

#include "app.h"
#include <time.h>

Go to the source code of this file.

Functions

static void timestring (char *t, int maxlen)
 Make base filename string from current system time.
static void make_record_filename (char *buf, int buflen, char *basename, char *dirname)
 Make actual file path name from base file name.
static void make_tmp_filename (char *buf, int buflen, char *dirname)
 Make temporary filename to store the incoming data while recording.
static void record_sample_open (Recog *recog, void *dummy)
 Open temporary file for starting recording.
static void record_sample_write (Recog *recog, SP16 *speech, int samplenum, void *dummy)
 Append speech segment to file previously opened by record_sample_open().
static void record_sample_close (Recog *recog, void *dummy)
 End recording.
static boolean opt_record (Jconf *jconf, char *arg[], int argnum)
void record_add_option ()
void record_setup (Recog *recog, void *data)

Variables

static char * record_dirname = NULL
static char rectmpfilename [MAXLINELEN]
static char recordfilename [MAXLINELEN]
static int recordlen
static FILE * recfile_fp


Detailed Description

Record speech inputs into successive files.

These functions record each input data to the corresponding file with file name of their time stamp in a format of "YYYY.MMDD.HHMMSS.wav". The audio format is Microsoft WAVE, 16bit, PCM (no compression).

The recording will not be stored in memory, instead it will be directly recorded to a temporary file on the fly. After an end-of-sentence found and the first pass ends, the temporary file will be moved to the final filename descrived above.

Author:
Akinobu Lee
Date:
Tue Sep 06 14:13:54 2005
Revision
1.1.1.1

Definition in file record.c.


Function Documentation

static void timestring ( char *  t,
int  maxlen 
) [static]

Make base filename string from current system time.

Parameters:
t [out] string buffer to hold the result string.
maxlen [in] the length of t.

Definition at line 67 of file record.c.

Referenced by record_sample_write().

static void make_record_filename ( char *  buf,
int  buflen,
char *  basename,
char *  dirname 
) [static]

Make actual file path name from base file name.

The recording directory should be specified by the global variable "record_dirname".

Parameters:
buf [out] buffer to hold the result string of this function
buflen [in] maximum length of buf.
filename [in] base filename.

Definition at line 97 of file record.c.

Referenced by record_sample_write().

static void make_tmp_filename ( char *  buf,
int  buflen,
char *  dirname 
) [static]

Make temporary filename to store the incoming data while recording.

Parameters:
buf [out] pointer of buffer to hold the resulting file name.
buflen [in] maximum length of buf.

Definition at line 127 of file record.c.

Referenced by record_sample_open().

static void record_sample_write ( Recog recog,
SP16 speech,
int  samplenum,
void *  dummy 
) [static]

Append speech segment to file previously opened by record_sample_open().

Parameters:
speech [in] speech buffer
samplenum [in] length of above in samples

Definition at line 179 of file record.c.

static void record_sample_close ( Recog recog,
void *  dummy 
) [static]

End recording.

Close the current temporary recording file, and rename the temporary file to the final time-stamp file name.

Definition at line 216 of file record.c.


Generated on Tue Dec 18 15:59:57 2007 for Julius by  doxygen 1.5.4