
Text-to-Speech
ASCII text may be queued for play using any of the text queuing functions described below. Play commences when the irEnd(3IRAPI) function is called. Voice and text may not be queued together. Any voice play requests that are queued must be played with irEnd(3IRAPI) and play must complete before text may be queued for play.
The following functions may be used to queue ASCII text for play:
- The irSay(3IRAPI) function is used to queue text from an open voice file descriptor. This file descriptor is obtained from irOpen(3IRAPI).
- The irBSay(3IRAPI) function is used to queue text from a buffer.
- The irFSay(3IRAPI) function is used to queue the entire contents of a specified file.
The following functions are used to control playing of queued text:
- The irEnd(3IRAPI) function is used to start the play of queued text. This puts the IRAPI in the IRS_SAYING state. The IRF_MORE flag may be used with this function to allow more text to be queued and played while the IRAPI is in the IRS_SAYING state. (This flag is not valid for voice play requests.) If the IRF_MORE flag is not used with irEnd(), the application must receive an IRE_SAY_DONE event to indicate play is complete before more text may be queued.
- The irStop(3IRAPI) function may be used to stop TTS activity on a channel before normal completion. Saying is stopped when the application receives an IRE_SAY_DONE event.
Note:
The irPlayResume(3IRAPI) function cannot be used for TTS. The irGetVCount(3IRAPI) function can be used for TTS.
- Applications should be written to handle the possible denial or delay of TTS resource allocation when irEnd() is used. Depending on the value of the IRP_RESOURCE_RETURNMODE parameter, irEnd() may return IRR_FAIL or IRR_PENDING if the TTS resource is not immediately available.