microsoft / Cognitive-SpeakerRecognition-Python

Python SDK for the Microsoft Speaker Recognition API, part of Cognitive Services
https://www.microsoft.com/cognitive-services/en-us/speaker-recognition-api
Other
110 stars 62 forks source link

Error: message Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) #9

Closed PotatoSpudowski closed 4 years ago

PotatoSpudowski commented 6 years ago

When I try to run Identifyfile i get this error. When I try to run the code on an enrolled profile I get the above error.

Here is the code I used import IdentificationServiceHttpClientHelper import sys

def identify_file(subscription_key, file_path, force_short_audio, profile_ids): """Identify an audio file on the server.

Arguments:
subscription_key -- the subscription key string
file_path -- the audio file path for identification
profile_ids -- an array of test profile IDs strings
force_short_audio -- waive the recommended minimum audio limit needed for enrollment
"""
helper = IdentificationServiceHttpClientHelper.IdentificationServiceHttpClientHelper(
    subscription_key)

identification_response = helper.identify_file(
    file_path, profile_ids,
    force_short_audio.lower() == "true")

print('Identified Speaker = {0}'.format(identification_response.get_identified_profile_id()))
print('Confidence = {0}'.format(identification_response.get_confidence()))

if name == "main":

if len(sys.argv) < 5:

#     print('Usage: python IdentifyFile.py <subscription_key> <identification_file_path>'
#           ' <profile_ids>...')
#     print('\t<subscription_key> is the subscription key for the service')
#     print('\t<identification_file_path> is the audio file path for identification')
#     print('\t<force_short_audio> True/False waives the recommended minimum audio limit needed '
#           'for enrollment')
#     print('\t<profile_ids> the profile IDs for the profiles to identify the audio from.')
#     sys.exit('Error: Incorrect Usage.')

identify_file('702227e**************', 'ironman/fan.wav', 'True', '6f3d4f1b-3b70-439d-8c78-2abb15fbc791')
PotatoSpudowski commented 6 years ago

Update: Its working. Should be identify_file('702227e**', 'ironman/fan.wav', 'True', profile_ID) where profile_ID is an array consisting of all the profile ids enrolled.

DirkLee-me commented 5 years ago

Could you please tell more about the details? I ran it in the Windows command line, and the same error occurred. What do you mean with "where profile_ID is an ARRAY consisting of all the profile ids enrolled"? Should I include it in a LIST?

PotatoSpudowski commented 4 years ago

Let's say your profile ID is "MYPROFILEID" then you should pass it as identify_file('Subscription key', 'Link to audio file', 'Force short audio option', ["MYPROFILEID"])

No idea why I raised this issue back then. Seems fairly straight forward now that I think about it. I was terrible at software development back then. Safe to say not much has changed :)