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
109 stars 62 forks source link

Error enrolling #6

Open Strumwulf opened 7 years ago

Strumwulf commented 7 years ago

When running the enrollProfile.py I'm getting the following error.

pi@raspberrypi:~/MS_spkr_recog $ python3 Identification/EnrollProfile.py ----------------------------------------- David "/home/pi/MS_spkr_recog/spkr_profile" true ERROR:root:Error enrolling profile. Traceback (most recent call last): File "Identification/EnrollProfile.py", line 70, in enroll_profile(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]) File "Identification/EnrollProfile.py", line 51, in enroll_profile force_short_audio.lower() == "true") File "/home/pi/MS_spkr_recog/Identification/IdentificationServiceHttpClientHelper.py", line 226, in enroll_profile with open(file_path, 'rb') as body: IsADirectoryError: [Errno 21] Is a directory: '/home/pi/MS_spkr_recog/spkr_profile'

Is the error due to the way the command line arguments are written, or is it something else. the dashes in the command line represent my subscription key.

Thank you,

David Stanley

hoda-gharieb commented 7 years ago

EnrollProfile.py expects:

  1. Subscription key
  2. Profile id
  3. audio file path
  4. (optional) true for forcing short audio

if "/home/pi/MS_spkr_recog/spkr_profile" is a path for a Directory, then it should be replaced with an audio file path.

Strumwulf commented 7 years ago

What's the difference between an directory and an audio path?

hoda-gharieb commented 7 years ago

By audio path here we meant the exact path of the audio file itself not its directory. For example, "home/pi/MS_spkr_recog/spkr_profile/test.wav"

Strumwulf commented 7 years ago

I've run the enrollprofile file with an audio path, and I'm getting the following error now:

python3 Identification/EnrollProfile.py xxxxxxxxxxxxxxxxxxxxxxxxxxx David /home/pi/MS_spkr_recog/spkr_profile/david3.wav true ERROR:root:Error enrolling profile. Traceback (most recent call last): File "Identification/EnrollProfile.py", line 70, in enroll_profile(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]) File "Identification/EnrollProfile.py", line 51, in enroll_profile force_short_audio.lower() == "true") File "/home/pi/MS_spkr_recog/Identification/IdentificationServiceHttpClientHelper.py", line 245, in enroll_profile raise Exception('Error enrolling profile: ' + reason) Exception: Error enrolling profile: { "error": { "code": "NotFound", "message": "Resource or path can't be found." } }

Any pointers on what causes this error?

nabil-k commented 7 years ago

You're using it wrong your supposed to do python3 EnrollProfile.py subscription_key profile_id enrollment_file_path force_short_audio I personally haven't tried using python3 Identification/EnrollProfile.py instead of python3 EnrollProfile.py but there shouldn't be a difference. I usually cd directly into a folder that I want to run a python file.

Also I don't why you're using 'David', you can't assign audio files to people name's like that. You'll have to create your own way, this library doesn't provide that.