(Page 6 of 14 in this chapter)
5.5 Recording
There are two types of recording functions.
The message oriented function,
vceRecordMessage
, operates on a specific message number. This function creates a new message, replacing the existing message, if any.
The position-oriented function,
vceRecord
, operates on the current message in the specified context. Recording starts from the current position in the most recently accessed message.
There are no buffer-oriented record functions. Use the ADI functions
adiRecordAsync
or
adiStartRecording
if you need direct access to buffers. Refer to
Chapter 7
for more information on the ADI Service: Playing/Recording. Refer to the
ADI Service Function Reference Manual
for more information on the ADI functions.
The
vcerec
demonstration program demonstrates copying messages from one voice file to another. Refer to
Section 13.2.9,
Voice File Record: vcerec
for more information.
5.5.1 Recording Functions
Recording optionally starts with a beep tone. The recording functions have a time limit. Silence detected during recording can optionally abort the recording.
The following table lists when to use the record functions available in the CT Access Voice Message service.
If you want to...
Then use this function...
Start recording at the current position in the current message
vceRecord
Record a message into a specified voice object
vceRecordMessage
5.5.2 Recording Completion Reasons
The following table lists the Voice Message service reason codes returned when record terminates. The reason is stated in the
value
field of the
VCEEVN_RECORD_DONE_EVENT
.
Note:
If record fails, the
value
field will contain an error code.
If...
Then recording ends with...
The time limit in
vceRecord
is reached
CTA_REASON_TIMEOUT
No more space is available in the voice object, or recording in overwrite mode reached the end of the existing message
CTA_REASON_FINISHED
Silence is detected at the beginning of recording
CTA_REASON_NO_VOICE
Silence occurs after some energy is recorded
CTA_REASON_VOICE_END
Record is stopped at any time by calling
vceStop
CTA_REASON_STOPPED
A touch tone digit is received and the corresponding bit in the DTMF abort parameter is set
CTA_REASON_DIGIT
The call is ended
CTA_REASON_RELEASED
Record is stopped because of a speech recognition event
CTA_REASON_RECOGNITION
You record to an object with an encoding that is not supported by the attached device service
CTAERR_FUNCTION_NOT_AVAIL
5.5.3 Resizing Messages
When a message is replaced by
vceRecordMessage
, the new message might be larger or smaller than the previous one. The ability to resize a message depends on the object and the position of the message in the object. A message in a VOX file or a message that is located at the end of a flat (unformatted) file can grow without limit (until the disk is full). A file can physically shrink if the message at the end of the file is replaced with a smaller one (the shrinkage occurs when the file is closed). A message in a memory block is limited to the size of the memory specified with
vceOpenMemory
.
5.5.4 Parameters
The record functions take an optional pointer to a parameter structure. If you pass
NULL
, the parameters take default values. Refer to
Section 3.5,
Managing Parameters
. Refer to Appendix D in the
CT Access Function Reference Manual
for more detailed information about the record parameters.
The parameters control the beep tone, silence detection, record gain (including optional Automatic Gain Control), and DTMF abort.
Automatic Gain Control (AGC)
is an algorithm applied to incoming speech (recording) before compression and storage so that the amplitude of the stored speech is kept at a target level.
Field Name
Default Value
Description
DTMFabort
0xffff
Abort on DTMF (bit mask).
gain
0 dB
The gain in dB applied to the signal before it is encoded. If Automatic Gain Control is enabled, this is the initial gain when recording starts. Valid range for AG boards is -54 to 24.
novoicetime
5000 ms
The maximum length of silence at the beginning of a recording before recording will be stopped with a reason of CTA_REASON_NO_VOICE. Use zero (0) to disable this timer. Valid range for AG boards is 0 - 65535.
silencetime
3000 ms
The maximum length of silence after audio energy has been detected before record will be stopped with a reason of CTA_REASON_VOICE_END. Use zero (0) to disable this timer. Valid range for AG boards is 0 - 65535.
silenceampl
-45dBm
The maximum signal level, in dBm, that is considered to be silence. Valid range for AG boards is -51 to -15.
beepfreq
1000 Hz
The frequency of the record beep tone. Use zero (0) to disable the beep. Valid range for AG boards is 200 - 3600.
beepampl
-20 dBm
The amplitude of the beep tone. Valid range for AG boards is
-54 to 3.
beeptime
200 ms
The duration of the beep. 0 disables the beep. Valid range for AG boards is 0 - 65535.
AGCenable
0
Flag to enable Automatic Gain Control.
Note:
When using AG boards, the parameters presented in the previous table override the corresponding fields in the
ADI.RECORD
category.
ADI.RECORD
contains additional fields which you can use to control Automatic Gain Control (AGC) characteristics.
Figures
43
,
44
, and
45
illustrate the three time windows that terminate the record function:
Figure 43. Record Termination - No Voice
Figure 44. Record Termination - Voice End
Figure 45. Record Termination - Timeout
(Page 6 of 14 in this chapter)
Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights reserved.