Skip to content

Conversation

@philhawthorne
Copy link
Contributor

Adds a Google Translate TTS Provider, allowing users to use TTS without
an API key from an existing provider.

Adds a Google Translate TTS Provider, allowing users to use TTS without
an API key from an existing provider.
@jishi
Copy link
Owner

jishi commented Dec 11, 2016

Thanks for this. However, given the way I load the different TTS providers, this would interfere with the priority order if it resides in the tts-providers folder, since I load them dynamically based and I can not guarantee the ordering of them. Meaning, that it would probably take google TTS before Microsoft or AWS for a lot of users (if not all), even though you have configuration for those other providers.

It needs to be pushed last onto the providers array in this file: https://github.com/jishi/node-sonos-http-api/blob/master/lib/helpers/try-download-tts.js in order to be just as a final attempt when no other provider has a configuration.

I should only read one level of files in my require-dir.js, so putting the google js file in a subfolder called "default" or something similar, and requiring it manually and adding it last to the providers array should suffice.

@philhawthorne
Copy link
Contributor Author

@jishi yeah I wasn't sure exactly how that part of the script was working. Looked like it was just loading all the providers available in that folder, and adding them to an array.

Moving forward, it might be better to introduce a new config parameter "tts_provider" in settings.json. This way, instead of looping over each TTS provider every time, the system can tell which TTS provider to use.

@jishi
Copy link
Owner

jishi commented Dec 11, 2016

Although it would be more performant, I think the overhead of empty Promises can be ignored when it simplifies the setup for the actual users. I believe that any configuration that can be omitted is a huge win from a user perspective :)

@jishi jishi merged commit 6980261 into jishi:master Dec 11, 2016
jishi added a commit that referenced this pull request Dec 11, 2016
When no other TTS provider is configured, use Google TTS
Allow VoiceId spec in URL for AWS Polly
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

Successfully merging this pull request may close these issues.

2 participants