Voice API for Windows Operating Systems Library Reference — November 2003 51
open an audio input device — ai_open( )
int main()
{
int aidev; /* Audio input device handle */
SC_TSINFO sc_tsinfo; /* Time slot information structure */
long scts; /* TDM bus time slot */
/* Open audio input device aiB1 */
if ((aidev = ai_open("aiB1")) < 0) {
/* process error */
}
/* Fill in the TDM bus time slot information */
sc_tsinfo.sc_numts = 1;
sc_tsinfo.sc_tsarrayp = &scts;
/* Get TDM bus time slot connected to transmit of audio input device */
if (ai_getxmitslot(aidev, &sc_tsinfo) < 0) {
/* process error */
}
else {
printf("%s is transmitting on TDM time slot %d", ATDV_NAMEP(aidev), scts);
}
/* Close audio input device */
if (ai_close(aidev) < 0) {
/* process error */
}
return 0;
}
!
!!
!See Also
ai_close( )
ai_getxmitslot( )
sr_getboardcnt( )