Skip to content

evalphobia/google-tts-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google TTS (Text-To-Speech) for golang

GoDoc License: MIT Release Build Status Co decov Coverage Go Report Card Code Climate BCH compliance

google-tts-go is a golang implementation of the token validation of Google Translate.

Quick Usage

package main

import (
	"fmt"

	"github.com/evalphobia/google-tts-go/googletts"
)

func main() {
	url, err := googletts.GetTTSURL("Hello world.", "en")
	if err != nil {
		panic(err)
	}
	fmt.Println(url) // => https://translate.google.com/translate_tts?client=t&ie=UTF-8&q=Hello%2C+world.&textlen=13&tk=368668.249914&tl=en

	tk, err := googletts.GetTTSToken("Hello world.")
	if err != nil {
		panic(err)
	}
	fmt.Println(tk) // => 368668.249914
}

Credit

The algorithm of this library is based on Boudewijn26/gTTS-token by Boudewijn26.