我正在使用SDK部分中給出的python包裝器。我一直在嘗試使用python API爲創建的配置文件註冊語音文件。揚聲器識別 - 微軟牛津版上的錯誤請求錯誤
我能夠創建配置文件併成功列出所有配置文件。但是,當我嘗試使用創建的配置文件註冊帶有簡單hello世界短語的語音(.wav)文件時,出現錯誤'錯誤:root:錯誤註冊配置文件'。其中跟蹤告訴'例外:錯誤註冊配置文件:錯誤請求'。我已經通過將模塊導入到我的python文件以及命令行中來使用,如自述文件中所述。
我不知道這個API是否可以工作。我不認爲我的小實驗有任何其他API。即使在SDK的問題部分也沒有適當的迴應。
PS:這是我的第一個問題。請原諒我的風格和格式。 以下是堆棧跟蹤:
ERROR:root:Error enrolling profile.
127.0.0.1 - - [17/May/2016 15:55:44] "POST /verify-voice HTTP/1.1" 500 -
INFO:werkzeug:127.0.0.1 - - [17/May/2016 15:55:44] "POST /verify-voice HTTP/1.1" 500 -
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Python/2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Rajagopal/Development/GitRepos/pet-projects/barabara-server/wsgi/barbara/views/users.py", line 57, in voice_register
enroll_profile(app.config['MICROSOFT_SPEAKER_RECOGNITION_KEY'], user.speaker_profile_id, _created_file_path)
File "/Rajagopal/Development/GitRepos/pet-projects/barabara-server/wsgi/oxford/speaker_recognition/Identification/EnrollProfile.py", line 48, in enroll_profile
enrollment_response = helper.enroll_profile(profile_id, file_path)
File "/Rajagopal/Development/GitRepos/pet-projects/barabara-server/wsgi/oxford/speaker_recognition/Identification/IdentificationServiceHttpClientHelper.py", line 155, in enroll_profile
raise Exception('Error enrolling profile: ' + res.reason)
Exception: Error enrolling profile: Bad Request
考慮在粘貼輸出或代碼時使用代碼格式。 – Anand
如果您分享引發此錯誤的代碼,這將非常有幫助。 –
正如我所提到的,我使用了微軟文檔頁面提供的python(包裝)SDK。這是[鏈接](https://github.com/Microsoft/ProjectOxford-ClientSDK/tree/master/SpeakerRecognition/Python)。我在命令提示符中使用了Identification/EnrollProfile.py,其中包含訂閱者ID(API密鑰),創建的配置文件ID和本地音頻文件,如自述文件中所述 –