julius/record.c File Reference

Record speech inputs into successive files. More...

#include <julius.h>
#include <time.h>

Include dependency graph for record.c:

Go to the source code of this file.

Defines

#define TSTRLEN   18
 String length of a time format.

Functions

static void timestring (char *t, int maxlen)
static void make_record_filename (char *buf, int buflen, char *filename)
static void make_tmp_filename (char *buf, int buflen)
void record_sample_open ()
void record_sample_write (SP16 *speech, int samplenum)
void record_sample_close ()

Variables

static char tstr [TSTRLEN]
 Work area to hold time string.
static char recfilename [MAXLINELEN]
 Temporary file name for storing the incoming data.
static char finalfilename [MAXLINELEN]
 After recording is done, the file will be renames to this.
static FILE * fp = NULL
 File pointer of current file.
static int totalnum
 Current number of recorded samples.


Detailed Description

Record speech inputs into successive files.

Author:
Akinobu Lee
Date:
Tue Sep 06 14:13:54 2005
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.

Revision
1.4

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 *  filename 
) [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_close().

static void make_tmp_filename ( char *  buf,
int  buflen 
) [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 126 of file record.c.

Referenced by record_sample_open().

void record_sample_open (  ) 

Open temporary file for starting recording.

Definition at line 146 of file record.c.

Referenced by main_recognition_loop(), and RealTimePipeLinePrepare().

void record_sample_write ( SP16 speech,
int  samplenum 
)

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 175 of file record.c.

Referenced by adin_cut_callback_store_buffer(), and RealTimePipeLine().

void record_sample_close (  ) 

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

Definition at line 207 of file record.c.

Referenced by main_recognition_loop().


Generated on Tue Dec 26 12:53:44 2006 for Julian by  doxygen 1.5.0