Я все еще сталкиваюсь с ошибкой в процессе проверки
{"error": {"code": "BadRequest", "message": "SpeakerInvalid"}} '
Мой звук правильный, так как его легко зарегистрировать
##code for API CALL speaker verification
import http.client, urllib.request, urllib.parse, urllib.error, base64
subscription_key = 'XXXXXXXXXXXXXXXXXXXXXXX'
headers = {
# Request headers
"Content-Type": 'multipart/form-data',
"Ocp-Apim-Subscription-Key": subscription_key,
}
params = urllib.parse.urlencode({
'verificationProfileId':'445b849b-6418-4443-961b-77bd88196223',
})
#body = {
#}
try:
conn = http.client.HTTPSConnection('speaker-recognition-api.cognitiveservices.azure.com')
body = open('pp.wav','rb') //pp.wav is my audio file
conn.request("POST", "/spid/v1.0/verify?verificationProfileId=445b849b-6418-4443-961b-77bd88196223?%s" % params, body, headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))