Skip to Content
It is currently March 5th, 2021, 1:53 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: September 11th, 2017, 4:40 pm 
Offline
New User
New User

Joined: June 23rd, 2017, 10:11 pm
Posts: 15
I have several "announcement scripts that use google translate to create an .mps file. Non of them wok. a file gets created but it appears to be empty.
for instance in my TrackAnnouncements.pal I have the following line of code:
<code>
WebToFile(map,'http://translate.google.com/translate_tts?tl=en&q='+ready);
</code>
using WriteLn and the output window, I've determined that ready ="Just%20for%20you%2CSleep%20Til%20October.%20from%20Alison%20Lee%20Freeman%20as%20Heaven%20Street.%20%20On%20Slurp.%20%20%20It%20is%2C16%2034%" which appears to be appended to the URL properly, But what I get back is an mp3 file that is 3 KB and i imprted it into the queue manually and it indicated a duration of "-0:00". This happens with all of my "announce scripts that use translate.google.com. Any ideas?


Top
 Profile  
Reply with quote  
PostPosted: September 12th, 2017, 9:31 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8156
Location: Cologne (Germany)
The TTS Engine of Google Translate isn't meant to be used by automated scripts (aka Bots).
It isn't even publicly documented how this works. People just noticed that the accessibility option in the Google Translate tool to read out the translated text was just a plaintext URL of the language and the text.
Now Google doesn't like it when you abuse their tools in a way they didn't want it to be used. Therefore they put a captcha page before the actual audio file if they detect non-human usage of their TTS API.
If you open the generated link in your browser you might (or might not) see a webpage with a recaptcha checkmark that you have to solve before it forwards you to the audio file.

For reproducible results, I recommend looking for an actual TTS API provider. If you keep your number of requests low, you could try the voicerss.org free tier. Their service works in a similar way so you can get an audio file by just building the correct URL. You have to sign up and get an API key first even to use the free tier, though.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: September 12th, 2017, 5:04 pm 
Offline
New User
New User

Joined: June 23rd, 2017, 10:11 pm
Posts: 15
I tried that and now it hangs SAMBC. I got an API key and verfied that the string I'm sending returns an .mp3 file but it doesn't work within the script. The file is ceated in the announcement directory but it is much smaller and SAMBC skips it. When I manually import it into SAM's queue, it has question marks where the duration is normally displayed. I'm using version 2015.5.


Top
 Profile  
Reply with quote  
PostPosted: September 13th, 2017, 5:20 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8156
Location: Cologne (Germany)
Well, apparently SAM has problems with low frequency, low sampling rate material.
The default format is 8bit sampling rate and 8kHz frequency, whereas usual MP3 music is 16bit and 44kHz

Try this:
Code:
http://api.voicerss.org/?key=<Your API Key>&hl=en-us&src=Hello,%20world!&c=MP3&f=44khz_16bit_stereo

Or even better the uncompressed wav version:
Code:
http://api.voicerss.org/?key=<Your API Key>&hl=en-us&src=Hello,%20world!&c=WAV&f=44khz_16bit_stereo

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: October 10th, 2020, 7:36 pm 
Offline
New User
New User

Joined: October 10th, 2020, 7:24 pm
Posts: 4
Has anyone tried using Google Cloud Translation for announcements ?

The quality of speech on it is great compared to other services like Voice RSS.

But I am a little lost as to how I can send the commands for it via something like WebToFile ???

Or maybe if there is another PAL command that could execute this the PowerShell to create the file prior to is being used later in the script?


Top
 Profile  
Reply with quote  
PostPosted: October 11th, 2020, 5:54 pm 
Offline
New User
New User

Joined: October 10th, 2020, 7:24 pm
Posts: 4
A link to the Google Cloud Translate page:
https://cloud.google.com/translate/docs ... quickstart

It seems like more a scripted method of setting up the speech sythesis request, rather than something that can be sent in a single line of webtoFile.


Top
 Profile  
Reply with quote  
PostPosted: October 14th, 2020, 3:04 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8156
Location: Cologne (Germany)
If you're looking for natural speech synthesis, check out Amazon Polly: https://aws.amazon.com/de/polly/

Gordon wrote:
It seems like more a scripted method of setting up the speech sythesis request, rather than something that can be sent in a single line of webtoFile.

Look into THttpClient instead of WebToFile for stuff that is not a plain GET-Request.
SAM can do this as of 2017.8

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group