Avaya Logo

Previous Topic

Next Topic

Book Contents

Book Index

Voice file descriptors

Voice file descriptors are similar to system file descriptors. They are used by IRAPI applications to position the voice file pointer to arbitrary points, measured in milliseconds, and then play or record from those positions.

A voice file descriptor is allocated via irOpen(3IRAPI) and released via irClose(3IRAPI). Once successfully opened, a voice file pointer may be re-positioned with irLSeek(3IRAPI), played via irPlay(3IRAPI), or recorded via irRecord(3IRAPI).

Unlike file descriptors, voice file descriptors are not positioned as data is played from or recorded to them. The application must position the voice file pointer. Since voice file pointers are positioned in milliseconds, the IRAPI application is neither required to know the algorithm type nor to perform time to byte conversions.

After receiving IRE_PLAY_DONE (for single voice file descriptor plays) or IRE_PLAY_DONE (for multiple voice object plays), a program could use irGetVCount(3IRAPI) reset the voice pointer. The following example shows how irGetVCount could be used to reposition the voice file descriptor after play completes.

/* At some point in the program a vfd is played... */

irPlay(cid, tag, vfd, 10000);
.
.
.
/* From the event processing routine ... */
while ( irWCheck(&ev) != IRR_FAIL ) {
.
.
.
case IRE_PLAY_DONE:

/* Assume that the event was due to the vfd played above
* reset voice file pointer to where play was stopped.
*/

irLSeek(vfd, irGetVCount(cid), SEEK_CUR );
.
.
.

© 2006 Avaya Inc. All Rights Reserved.