Voice API Programming Guide — June 2005 109
Recording and Playback
exit(1);
}
if (dx_close(chdev2) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev2), ATDV_NAMEP(chdev2));
exit(1);
}
if (ms_close(msdev1) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(chdev1), ATDV_NAMEP(chdev1));
exit(1);
}
if (ms_close(msdev2) == -1) {
printf("Error message = %s, on %s", ATDV_ERRMSGP(msdev2), ATDV_NAMEP(msdev2));
exit(1);
}
return(0);
}
8.12.4.2 How to Set Up an ECR Play Over the TDM busIn this model, two MSI/SC station devices are connected via the TDM bus to two voice channel
devices. The second voice channel device is operating in ECR mode. Two telephones are connected
to the MSI/SC stations for providing input and listening to the echo-cancelled output of the second
voice device, and to the non-echo-cancelled output of the first voice device. See Figure18, “An
ECR Play Over the TDM bus”, on page110.
Perform the following to set up an ECR play over the TDM bus:
1. Get TDM bus transmit time slots of both MSI/SC devices and the ECR transmit time slots of
the two voice channel devices.
ms_getxmitslot (MS1, &MS1_TX);
dx_getxmitslot (CH1, &CH1_TX);
dx_getxmitslotecr (CH2, &CH2_ECR_TX);
2. Have the MSI/SC station 1 listen to the transmit (TX) of channel 1.
ms_listen (MS1, & CH1_TX);
3. Have MSI/SC station 2 listen to the ECR transmit of channel 2.
ms_listen (MS2, & CH2_ECR_TX);
4. Have voice channel 2 listen to MSI/SC station 1’s transmit.
dx_listen (CH2, & MS1_TX);
5. Have voice channel 2 connect its echo canceller’s receive time slot to transmit of channel 1.
This signal is used as the echo reference signal.
dx_listenecr (CH2, & CH1_TX);