Skip to content

Instantly share code, notes, and snippets.

@KararTY
Last active August 4, 2020 18:04
Show Gist options
  • Save KararTY/d3c01f06c34873e7293fa8dc10483047 to your computer and use it in GitHub Desktop.
Save KararTY/d3c01f06c34873e7293fa8dc10483047 to your computer and use it in GitHub Desktop.
## GoogleTranslateTTS
http://translate.google.com/translate_tts
?ie=UTF-8
&total=1
&idx=0
&client=tw-ob
&prev=input
&textlen=<LENGTH>
&q=<TEXT>
&tl=<LOCALE>
&ttsspeed=<SPEED>
Request MUST be GET & HTTP.
HTTPS does work but there are reported errors in the wild of the end-point (sometimes?) requesting an API token.
Maximum text length is 200. It will 404 if you go above that limit.
<LENGTH> is the text length. Found out it's optional, but might as well fill it out.
<TEXT> is the requested text. encodeURIComponent()
<LOCALE> example locales JSON stringified, I'm sure there may be more: [{"locale":"en-gb","language":"English"},{"locale":"en-us","language":"English"},{"locale":"en-au","language":"English"},{"locale":"en-in","language":"English"},{"locale":"ar","language":"Arabic"},{"locale":"bn-bd","language":"Bengali"},{"locale":"zh-cn","language":"Chinese"},{"locale":"cs-cz","language":"Czech"},{"locale":"da-dk","language":"Danish"},{"locale":"nl-nl","language":"Dutch"},{"locale":"et-ee","language":"Estonian"},{"locale":"tl-ph","language":"Filipino (Tagalog)"},{"locale":"fi-fi","language":"Finnish"},{"locale":"fr-fr","language":"French"},{"locale":"fr-ca","language":"French"},{"locale":"de-de","language":"German"},{"locale":"el-gr","language":"Greek"},{"locale":"hi-in","language":"Hindi"},{"locale":"hu-hu","language":"Hungarian"},{"locale":"it-it","language":"Italian"},{"locale":"id-id","language":"Indonesian"},{"locale":"ja-jp","language":"Japanese"},{"locale":"jw-id","language":"Javanese"},{"locale":"km-kh","language":"Khmer"},{"locale":"ko-kr","language":"Korean"},{"locale":"la","language":"Latin"},{"locale":"ml-in","language":"Malayalam"},{"locale":"mr-in","language":"Marathi"},{"locale":"my-mm","language":"Myanmar (Burmese)"},{"locale":"ne-np","language":"Nepali"},{"locale":"nb-no","language":"Norwegian"},{"locale":"pl-pl","language":"Polish"},{"locale":"pt-pt","language":"Portuguese"},{"locale":"pt-br","language":"Portuguese"},{"locale":"ro-ro","language":"Romanian"},{"locale":"ru-ru","language":"Russian"},{"locale":"si-lk","language":"Sinhala"},{"locale":"sk-sk","language":"Slovak"},{"locale":"es-es","language":"Spanish"},{"locale":"es-mx","language":"Spanish"},{"locale":"su-sd","language":"Sudanese"},{"locale":"sv-se","language":"Swedish"},{"locale":"ta-in","language":"Tamil"},{"locale":"te-in","language":"Telugu"},{"locale":"th-th","language":"Thai"},{"locale":"tr-tr","language":"Turkish"},{"locale":"uk-ua","language":"Ukrainian"},{"locale":"vi-vn","language":"Vietnamese"}]
<SPEED> Float from 0 to 1 (0.1, 0.2 ... 1) Default is 1.
Example url:
http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&client=tw-ob&prev=input&textlen=178&q=If%20your%20a%20fucking%20full%20grown%20Aussie%2C%20this%20is%20what%20you%E2%80%99d%20have%20for%20breakfast%20you%20fucking%20dog%20cunts%2C%20a%20fackin%E2%80%99%20VB%20LONGNECK%20At%2020%20to%20eight%20at%20in%20the%20fucking%20Morning%20get%20that%20up%20there&tl=en-au&ttsspeed=0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment