Play tones with the specified consecutive numbers. Tone numbers are determined by the device. You can view the tone numbers in Voice Test menu of the device. Generally, the values range from 0 to 11.
Start tone number
End tone number
Return True if it is successful, or return False.
PlayVoiceByIndex
private int playVoice(string ipAddr, int port, int iPosition, int iLength) { int idwErrorCode = 0; //Create Standalone SDK class dynamicly. zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass(); if (axCZKEM1.Connect_Net(ipAddr, 4370)) { if (axCZKEM1.PlayVoice(iPosition, iLength)) { MessageBox.Show("Play Voice from " + iPosition.ToString() + " to " + iLength.ToString(), "Success"); } else { axCZKEM1.GetLastError(ref idwErrorCode); MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error"); } } else { axCZKEM1.GetLastError(ref idwErrorCode); } axCZKEM1.Disconnect(); return idwErrorCode; }
Private Sub playVoice(ipAddr As String, port As Int32, iPosition As Integer, iLength As Integer) 'Create Standalone SDK class dynamicly. Dim axCZKEM1 As New zkemkeeper.CZKEM Dim iMachineNumber As Integer Dim idwErrorCode As Integer Dim iUpdateFlag As Integer = 1 If axCZKEM1.Connect_Net(ipAddr, port) = True Then axCZKEM1.EnableDevice(iMachineNumber, False) If axCZKEM1.PlayVoice(iPosition, iLength) = True Then MsgBox("Play Voice from " + iPosition.ToString() + " to " + iLength.ToString(), MsgBoxStyle.Information, "Success") Else axCZKEM1.GetLastError(idwErrorCode) MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error") End If Else axCZKEM1.GetLastError(idwErrorCode) End If axCZKEM1.Disconnect() End Sub