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

Google Text To Speech (TTS) #554

Open
344Clinton opened this issue Nov 4, 2015 · 0 comments
Open

Google Text To Speech (TTS) #554

344Clinton opened this issue Nov 4, 2015 · 0 comments

Comments

@344Clinton
Copy link

I tried using google TTS service instead of Festival and found it doesn't work.
in Voice_Text.pm, the line containing:
my $ua_request = HTTP::Request->new('GET' => "http://translate.google.com/translate_tts?tl=$language&q=".qq[ $parms{text} ]);

contains a hard coded link, that is defunct. Google now requires a "Captcha".

The site "http://www.voicerss.org" allows one to register (FREE) for an API key and access Googles TTS service directly.

I updated the line as:
my $ua_request = HTTP::Request->new('GET' => "http://api.voicerss.org/?key=MY_API_KEY&hl=en-gb&f=48khz_16bit_stereo&src=".qq[ $parms{text} ]);

and it works.

However. The link should NOT be hardcoded as everyone knows, the web is always evolving. The link should be editable from the mh.privat.ini file as something like:

google_tts_url = "http://api.voicerss.org/?key=MY_API_KEY&hl=en-gb&f=48khz_16bit_stereo&src="

and then the code would be something like:
my $ua_request = HTTP::Request->new('GET' => $params{google_tts_url}.qq[ $parms{text} ]);

This way, as links change, the end user can modify them easily without trying to figure out where!

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