lib/v20190614/client.rb in tencentcloud-sdk-asr-3.0.605 vs lib/v20190614/client.rb in tencentcloud-sdk-asr-3.0.606
- old
+ new
@@ -533,9 +533,111 @@
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
+ # 本接口用于以删除已经注册的说话人信息(删除之后,原有的说话人ID和说话人音频数据都会失效)
+
+ # @param request: Request instance for VoicePrintDelete.
+ # @type request: :class:`Tencentcloud::asr::V20190614::VoicePrintDeleteRequest`
+ # @rtype: :class:`Tencentcloud::asr::V20190614::VoicePrintDeleteResponse`
+ def VoicePrintDelete(request)
+ body = send_request('VoicePrintDelete', request.serialize)
+ response = JSON.parse(body)
+ if response['Response'].key?('Error') == false
+ model = VoicePrintDeleteResponse.new
+ model.deserialize(response['Response'])
+ model
+ else
+ code = response['Response']['Error']['Code']
+ message = response['Response']['Error']['Message']
+ reqid = response['Response']['RequestId']
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
+ end
+ rescue TencentCloud::Common::TencentCloudSDKException => e
+ raise e
+ rescue StandardError => e
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
+ end
+
+ # 说话人注册接口用于注册一个指定音频,生成一个唯一的说话人id,后续可通过说话人验证接口验证其它音频和已有的说话人ID匹配度,注册时可指定说话人昵称,方便标识说话人ID, 说话人昵称可重复配置。
+ # (注: 一个appid最多可以注册1000个说话人ID,一个说话人ID仅支持一条音频注册,后续可通过更新接口进行更新)
+
+ # 使用须知
+ # 支持的输入格式:编码文件(PCM, WAV)、16 bit采样位数、单声道(mono)。
+
+ # 支持的音频采样率:16000 Hz。
+
+ # @param request: Request instance for VoicePrintEnroll.
+ # @type request: :class:`Tencentcloud::asr::V20190614::VoicePrintEnrollRequest`
+ # @rtype: :class:`Tencentcloud::asr::V20190614::VoicePrintEnrollResponse`
+ def VoicePrintEnroll(request)
+ body = send_request('VoicePrintEnroll', request.serialize)
+ response = JSON.parse(body)
+ if response['Response'].key?('Error') == false
+ model = VoicePrintEnrollResponse.new
+ model.deserialize(response['Response'])
+ model
+ else
+ code = response['Response']['Error']['Code']
+ message = response['Response']['Error']['Message']
+ reqid = response['Response']['RequestId']
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
+ end
+ rescue TencentCloud::Common::TencentCloudSDKException => e
+ raise e
+ rescue StandardError => e
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
+ end
+
+ # 本接口用于更新和覆盖已注册的音频数据和说话人昵称,更新后原有的音频数据将失效。
+
+ # @param request: Request instance for VoicePrintUpdate.
+ # @type request: :class:`Tencentcloud::asr::V20190614::VoicePrintUpdateRequest`
+ # @rtype: :class:`Tencentcloud::asr::V20190614::VoicePrintUpdateResponse`
+ def VoicePrintUpdate(request)
+ body = send_request('VoicePrintUpdate', request.serialize)
+ response = JSON.parse(body)
+ if response['Response'].key?('Error') == false
+ model = VoicePrintUpdateResponse.new
+ model.deserialize(response['Response'])
+ model
+ else
+ code = response['Response']['Error']['Code']
+ message = response['Response']['Error']['Message']
+ reqid = response['Response']['RequestId']
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
+ end
+ rescue TencentCloud::Common::TencentCloudSDKException => e
+ raise e
+ rescue StandardError => e
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
+ end
+
+ # 本接口用于校验传入音频与已注册音频的匹配程度,通过指定说话人ID(VoicePrintId)和一段音频进行音频和说话人的匹配度判断
+
+ # @param request: Request instance for VoicePrintVerify.
+ # @type request: :class:`Tencentcloud::asr::V20190614::VoicePrintVerifyRequest`
+ # @rtype: :class:`Tencentcloud::asr::V20190614::VoicePrintVerifyResponse`
+ def VoicePrintVerify(request)
+ body = send_request('VoicePrintVerify', request.serialize)
+ response = JSON.parse(body)
+ if response['Response'].key?('Error') == false
+ model = VoicePrintVerifyResponse.new
+ model.deserialize(response['Response'])
+ model
+ else
+ code = response['Response']['Error']['Code']
+ message = response['Response']['Error']['Message']
+ reqid = response['Response']['RequestId']
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
+ end
+ rescue TencentCloud::Common::TencentCloudSDKException => e
+ raise e
+ rescue StandardError => e
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
+ end
+
end
end
end
end
\ No newline at end of file