Closed ProgramComputer closed 7 months ago
Phew, I finally managed to merge it :hot_face:
Instead of saving it as a cookie, it will be saved in the database as a language entity. The automatic database update will come a bit later but you can change it manually running ALTER TABLE languages ADD COLUMN LgTTSVoiceAPI varchar(2048) NOT NULL
.
I also created a discussion on #174 so that users can share their tips. Inside LWT, the documentation is minimal for now, I may expend it later (I plan on scavenging data from #174).
It's a nice feature, great job on this!
As implied in #143, there are multiple TTS services that LWT can add functionality for especially the common ones; however, the varied authentication required for most can lead to bloat not to mention your desired TTS service not being present.
With this pull request, a generality of TTS-calls is used for customizability on the user-end whether Azure, Google Cloud, ... * as long as the response contains a data: URI.
A key note is that prior authorization is up to the user to configure. The user will have to provide it in the fetch JSON.
Input is the resource itself to fetch including any URL params. Options are the modifiers supplied to the call.
A placeholder of 'lwt_text' is required in the below object. lwt_lang is an optional placeholder for the lang code.
Leave the textarea empty to disable otherwise default browser SpeechAPI won't run. The format is below.
steps to test
In text-to-speech settings add the request in JSON format to the Voice API Request text area and save.
Then in read mode, click the audio buttons.
limitations
If there is an API word limit, the read browser button may not run at all as API returns empty.
To enable, it is required that LWT TTS cookies be allowed to be stored.
next steps
Currently 'lwt_text' and 'lwt_lang' placeholders are revealed for user customizability but pitch and rate could also be given.
example request
As using subscriber services from Amazon Polly or Google text-to-speech would require authentication, huggingface is used for the example. The following can be pasted for the Japanese language text-to-speech configuration.
user contribs
If you would like, reply to the thread with the parameters you used in a successful JSON request call for whichever particular resource such as Azure, Polly, or Google text-to-speech as some resources are authentication tedious.