Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micorosft TTS Error 401 when invoiking /synthesize #905

Open
JsChiSurf opened this issue Nov 2, 2024 · 2 comments
Open

Micorosft TTS Error 401 when invoiking /synthesize #905

JsChiSurf opened this issue Nov 2, 2024 · 2 comments

Comments

@JsChiSurf
Copy link

JsChiSurf commented Nov 2, 2024

Hi All,

Been using this great library since 2017 and it has worked flawlessly.

I realized last night that out of the blue some of my various scheduled announcements were not running, so I pulled up a direct call in my browser, such as:

http://192.168.1.136:5005/sayall/hellow%20world/Catherine/70

And when doing the above (or any other TTS comands), am now receiving the following out of the blue (w/o any other sort of system changes, upgrades, installs, etc):

{"status":"error","error":"Got status 401 when invoking /synthesize","stack":"[object Object]\n at /home/pi/downloads/node-sonos-http-api/lib/tts-providers/microsoft.js:88:12\n at process._tickDomainCallback (internal/process/next_tick.js:129:7)"}

I checked to make sure my API Key didn't expire and I can manually make curl calls to request a new token, etc, w/o issue, but the synthesize has stopped working even with the most simple one or two words text phrase (hello world in the above example).

I see some references to others out there that it may reflect an issue with the service itself, so am wondering if anyone else is seeing the same issue.

Thanks.

@JsChiSurf
Copy link
Author

Raw console log output versions this library's formatted error output (basically same thing just a bit more verbose):

2024-11-02T13:12:01.171Z INFO http server listening on 0.0.0.0 port 5005
2024-11-02T13:12:09.104Z INFO announce file for phrase "your" does not seem to exist, downloading
2024-11-02T13:12:09.820Z ERROR
Error
at /home/pi/node-sonos-http-api/lib/tts-providers/microsoft.js:88:12
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2024-11-02T13:12:09.821Z ERROR
Error
at /home/pi/node-sonos-http-api/lib/tts-providers/microsoft.js:88:12
at processTicksAndRejections (node:internal/process/task_queues:96:5)
(node:5208) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsa fe(), or Buffer.from() methods instead.
(Use node --trace-deprecation ... to show where the warning was created)

@JsChiSurf
Copy link
Author

Not sure if anyone else has/had been experiencing the same issue with the Microsoft TTS API, but I think this may have to do with deprecation of the old API / voices, etc, in favor of the Azure AI Speech TTS and use of the 'Neural' AI voices.

I created a new API key under the Azure TTS service, updated the endpoints in this library for both authorization and synthesizing (based on regional servers / your location), as well as created a new VOICE array in the script (microsoft.js) with the updated available names, and all is working well again.

I do miss the BenjaminRUS voice, but there are many other nice ones to choose from and they are definitely more natural.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant