(Page 6 of 18 in this chapter)
2.5 Voice Record and Play
AG Access provides functions for recording and playing speech data. There are three methods by which the application can transfer speech data to and from the AG board using AG Access :
single memory transaction
: The application submits a single data buffer to AG Access.
asynchronous transfer
: The application serially submits multiple data buffers by exchanging commands and events with AG Access.
callback transfer
: AG Access manages the buffers and invokes an application callback procedure to retrieve or store data.
2.5.1 Play and Record Functions
Choose a set of functions to initiate play or record operations as appropriate to your applications's data transfer method, according to the following table:
Operation
Memory Transaction
Asynchronous
Callback
Play
adiPlayFromMemory
adiPlayAsync
adiStartPlaying
Record
adiRecordToMemory
adiRecordAsync
adiStartRecording
2.5.2 Terminating Play or Record Operations
The functions to stop play or record operations are the same regardless of data transfer method:
To...
Use...
Terminate the play operation
adiStopPlaying
Terminate the record operation
adiStopRecording
2.5.3 Buffer Management Functions
For the asynchronous data transfer methods, each buffer is submitted using a function call, as follows:
To...
Use...
Supply a buffer to an asynchronous play operation
adiSubmitPlayBuffer
Supply a buffer for an asynchronous record operation
adiSubmitRecordBuffer
2.5.4 Status and Modification Functions
The following functions provide status information or modify an active play or record operation:
To...
Use...
Change the gain applied to the speech while playing
adiModifyPlayGain
Change the play speed while playing
adiModifyPlaySpeed
Retrieve play (or last play) status
adiGetPlayStatus
Retrieve record (or last record) status
adiGetRecordStatus
Return frame size, data rate, and max buffer size for a given encoding format
adiGetEncodingInfo
(Page 6 of 18 in this chapter)
Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights reserved.