Voice Record and
Playback Functions
4.2 Voice Encoding Formats
(Page 3 of 8 in this chapter)
- When recording or playing speech files, the application must select an encoding
format. The primary issue to consider when selecting a format is the compression
ratio vs. fidelity. More aggressive compression requires less disk space and
reduces host-to-AG loading.
- On heavily loaded systems, the throughput requirements between the host and the
AG board may cause gaps in the speech record/playback. This is called an
"underrun condition." Greater compression may be necessary in this case to
eliminate the problem.
- The AG Access library supports multiple file encoding formats which are listed in
the table below. The encoding is the suffix for ADI_ENCODE_ names used when
writing 'C' code. For example, ADI_ENCODE_NMS_24 is the NMS_24 encoding.
- The AG board processes speech in atomic units called voice frames. Frames vary
in size and duration depending upon the encoding format. The following table
specifies physical constants for each encoding format.
4.2.1 Buffer Sizes
- All play buffers submitted to AG Access must be an integral number of frames for
the selected encoding format. For example, if you select ADI_ENCODE_NMS_24,
the play buffer size must be a multiple of 62 bytes. Failure to submit a play buffer
meeting this size requirement causes the function to terminate with an
ADIERR_BAD_SIZE reason. Other than the multiple frame size requirement,
buffers submitted to AG Access can be of arbitrary size.
- Each AG board has a physical buffer size which is both board and encoding
dependent. If you submit a buffer larger than the physical size, AG Access divides
the buffer into physical segments and submits those segments to the AG board. To
eliminate fractional buffers and to reduce the AG-to-host interactions, the
optimum user buffer will be a multiple of the physical AG buffer size. This size is
retrieved via the function adiGetEncodingInfo.
(Page 3 of 8 in this chapter)
Copyright 1996 Natural MicroSystems, Inc. All Rights Reserved.