lib/v20190614/client.rb in tencentcloud-sdk-asr-3.0.762 vs lib/v20190614/client.rb in tencentcloud-sdk-asr-3.0.763
- old
+ new
@@ -535,9 +535,33 @@
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
+ # 通过比对两段音频内说话人的声纹,得到一个打分,可通过打分判断两段音频声纹相似度, 打分区间[0 - 100]。 音频要求:16k采样率, 16bit位深,pcm或者wav格式, 单声道,总时长不超过30秒的音频,base64编码数据大小不超过2M,音频内容只有一个说话人声音,并且尽可能清晰,这样结果更加准确。
+
+ # @param request: Request instance for VoicePrintCompare.
+ # @type request: :class:`Tencentcloud::asr::V20190614::VoicePrintCompareRequest`
+ # @rtype: :class:`Tencentcloud::asr::V20190614::VoicePrintCompareResponse`
+ def VoicePrintCompare(request)
+ body = send_request('VoicePrintCompare', request.serialize)
+ response = JSON.parse(body)
+ if response['Response'].key?('Error') == false
+ model = VoicePrintCompareResponse.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总数
# @param request: Request instance for VoicePrintCount.
# @type request: :class:`Tencentcloud::asr::V20190614::VoicePrintCountRequest`
# @rtype: :class:`Tencentcloud::asr::V20190614::VoicePrintCountResponse`
\ No newline at end of file