PlayVoiceByIndex

Definition

VARIANT_BOOL PlayVoice([in] LONG Position, [in] LONG Length)

Usage

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.

Parameter

Position Start tone number
Length End tone number

ReturnValue

Return True if it is successful, or return False.

RelatedFunction

PlayVoiceByIndex

 

Ejemplo

C#

private int playVoicebyIndex(string ipAddr, int port, int iIndex)
        {
int idwErrorCode = 0;
//Create Standalone SDK class dynamicly.
            zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
if (axCZKEM1.Connect_Net(ipAddr, 4370))
            {
if (axCZKEM1.PlayVoiceByIndex(iIndex))
                {
                    MessageBox.Show("PlayVoiceByIndex " + iIndex.ToString(), "Success");
                }
else
                {
                    axCZKEM1.GetLastError(ref idwErrorCode);
                    MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
                }
            }
else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
            }
            axCZKEM1.Disconnect();
return idwErrorCode;
        }

VB

Private Sub playVoiceByIndex(ipAddr As String, port As Int32, iIndex 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.PlayVoiceByIndex(iIndex) = True Then
                MsgBox("PlayVoiceByIndex " + iIndex.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