88 Voice API Programming Guide — June 2005
Recording and Playback
8.2 Digital Recording and Playback
In digital speech recording, the voice board converts the human voice from a continuous sound
wave, or analog signal, into a digital representation. The voice board does this by frequently
sampling the amplitude of the sound wave at individual points in the speech signal.
The accuracy, and thus the quality, of the digital recording is affected by:
the sampling rate (number of samples per second), also called digitization rate
the precision, or resolution, of each sample (the amount of data that is used to represent 1
sample).
If the samples are taken at a greater frequency, the digital representation will be more accurate and
the voice quality will be greater. Likewise, if more bits are used to represent the sample (higher
resolution), the sample will be more accurate and the voice quality will be greater.
In digital speech playback, the voice board reconstructs the speech signal by converting the
digitized voice back into analog voltages. If the voice data is played back at the same rate at which
it was recorded, an approximation of the original speech will result.
8.3 Play and Record Functions
The C language function library includes several functions for recording and playing audio data,
such as dx_rec( ), dx_reciottdata( ), dx_play( ), and dx_playiottdata( ). Recording takes audio
data from a specified channel and encodes it for storage in memory, in a file on disk, or on a custom
device. Playing decodes the stored audio data and plays it on the specified channel. The storage
location is one factor in determining which record and play functions should be used. The storage
location affects the access speed for retrieving and storing audio data.
One or more of the following data structures are used in conjunction with certain play and record
functions: DV_TPT to specify a termination condition for the function, DX_IOTT to identify a
source or destination for the data, and DX_XPB to specify the file format, data format, sampling
rate, and resolution.
For detailed information about play and record functions, which are also known as I/O functions,
see the Voice API Library Reference.
8.4 Play and Record Convenience Functions
Several convenience functions are provided to make it easier to implement play and record
functionality in an application. Some examples are: dx_playf( ), dx_playvox( ), dx_playwav( ),
dx_recf(), and dx_recvox ( ). These functions are specific cases of the dx_play() and dx_rec( )
functions and run in synchronous mode.
For example, dx_playf() p erforms a playback from a single file by specifying the filename. The
same operation can be done using dx_play( ) and specifying a DX_IOTT structure with only one