Skip to content

Latest commit

 

History

History
61 lines (48 loc) · 2.39 KB

README.md

File metadata and controls

61 lines (48 loc) · 2.39 KB

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.