SetCustomizeVoice

Definition

Usage

Set customized voice according to the original voice number. Note: This function is a

customized function. To use this function, the device must support customized voice. For

details, see EnableCustomizeVoice.

Parameter

Device number

Original voice number

Name of customized voice file (including the path)

Return Value

Return True if it is successful, or return False.

Related Function

DelCustomizeVoice, EnableCustomizeVoice

 

Ejemplo

C#

        /// <summary>
/// Set customized voice according to the original voice number. Note: This function is a customized function. 
/// To use this function, the device must support customized voice. For details, see EnableCustomizeVoice. 
/// </summary>
/// <param name="VoiceID ">Original voice number</param>
/// <param name="IP"> Ip of device </param>
/// <param name="Port"> Port of Device </param>
/// <param name="MachineNumber"> Device Number </param>
private void SetCustomizeVoice(int VoiceID, string FileName = "", string IP = "10.0.0.44", int Port = 4370, int MachineNumber = 1)
{
        //Create Standalone SDK class dynamicly.
	zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
	axCZKEM1.Connect_Net(IP, Port);
        int idwErrorCode = 0;
        if (axCZKEM1.SetCustomizeVoice(MachineNumber, VoiceID, FileName))
	{
		MessageBox.Show("SetCustomizeVoice! ", "Success");
	}
        else
	{
		axCZKEM1.GetLastError(ref idwErrorCode);
		MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
	}
}

VB

        ''' <summary>
        ''' Set customized voice according to the original voice number. Note: This function is a customized function. 
        ''' To use this function, the device must support customized voice. For details, see EnableCustomizeVoice. 
        ''' </summary>
        ''' <param name="VoiceID ">Original voice number</param>
        ''' <param name="IP"> Ip of device </param>
        ''' <param name="Port"> Port of Device </param>
        ''' <param name="MachineNumber"> Device Number </param>
        Private Sub SetCustomizeVoice(ByVal VoiceID As Integer, Optional FileName As String = "", Optional IP As String = "10.0.0.44", Optional Port As Integer = 4370, Optional MachineNumber As Integer = 1)
        'Create Standalone SDK class dynamicly.
        Dim axCZKEM1 As zkemkeeper.CZKEMClass = New zkemkeeper.CZKEMClass()
        axCZKEM1.Connect_Net(IP, Port)
        Dim idwErrorCode As Integer = 0
        If axCZKEM1.SetCustomizeVoice(MachineNumber, VoiceID, FileName) Then
            MessageBox.Show("SetCustomizeVoice! ", "Success")
        Else
            axCZKEM1.GetLastError(idwErrorCode)
            MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error")
        End If
        End Sub