irFRecord - record speech into a voice file via a voice file name
#include <irapi.h>
int irFRecord (channel_id cid, int tag, const char* voice_file, long count, int remember);
irFRecord records speech over a voice channel indicated by a channel identifier (cid). The cid is obtained by calling irInit(3IRAPI).
Tag is a user supplied number that associates the record function call with a subsequent event. The event is returned in an event structure (ir_event_struct) that is accessed by irCheck(3IRAPI).
The remember value is currently unused (see more in OBSOLETE section).
irFRecord(3IRAPI) opens the named voice_file, records the voice_file from the beginning, then closes the file. Up to count milliseconds are recorded unless interrupted (see discussion of interrupt below). If count equals 0, then irFRecord records until terminated by silence timeout, another interrupt, or a write error. Voice_file is created with a default "0644" permission mode, unless IRP_CREATE_MODE specified some other value [see IrPARAMETERS(4IRAPI)].
The IRP_RECORD_TONE parameter specifies whether a recording tone is to be used and the IRP_RECORD_ALGO parameter, which specifies the recording algorithm to be used by irFRecord, is currently ignored since ITU G.711 is the only algorithm currently supported. IRP_RECORD_PRETIME specifies the initial silence timeout and IRP_RECORD_INTERTIME specifies the interutterance timeout. All parameters are set to reasonable defaults [see IrPARAMETERS(4IRAPI)]. Existing values for these parameters can be retrieved using irGetParam(3IRAPI) while new values can be assigned to them using irSetParam(3IRAPI).
These parameters must be set to the desired values before invoking irFRecord since it uses the value of these parameters available at the time it is called.
irFRecord can be terminated when an enabled interrupt occurs [see irSetEvent(3IRAPI)]. An IRE_RECORD_DONE event is generated when recording is done for any reason.
If the library state is IRS_IDLE (not recording), calling irFRecord changes the library state to IRS_RECORDING. See irIntro(3IRAPI) for a discussion of library states.
irGetVCount(3IRAPI) is used to obtain the number of bytes recorded after an IRE_RECORD_DONE event is received.
An IRE_RECORD_DONE event is generated when irFRecord completes. The reason for record completion is contained in event_mod1.
irFRecord returns IRR_OK if the record request is successfully initiated.
IRR_FAIL is returned if an error occurs.
irError is set as follows if an error occurs:
IRER_INVALID if any of the arguments are invalid
IRER_BADSTATE if the channel is not in the IRS_IDLE state
IRER_OVERFLOW if the value of voice_file is too long
IRER_SYSERROR if a system or driver call failure occurs (check irSysError for additional information)
irPlay(3IRAPI), irByte2Time(3IRAPI), irTime2Byte(3IRAPI), irOpen(3IRAPI), irRecordResume(3IRAPI), irPlayResume(3IRAPI), irGetVCount(3IRAPI) and IrEVENTS(4IRAPI).
The following varieties of record are now obsolete:
int irRecord (channel_id cid, int tag, vf_descriptor vfd, long count, int remember);
int irBRecord (channel_id cid, int tag, char*buf, long count);
The remember parameter is currently ignored because irRecordResume(3IRAPI) is currently unsupported.
IRP_RECORD_GAIN is currently unsupported.
IRR_PENDING is no longer returned.
This is version 12/05/02 of this man page.