xfyun online tts binding for Go (Golang)
go get -u gitlab.com/xiayesuifeng/go-xfyun-tts
package main
import (
"gitlab.com/xiayesuifeng/go-xfyun-tts"
"io/ioutil"
"log"
)
func main() {
client := xfyun.NewClient(APP_ID, API_key, API_SECRET)
b := xfyun.NewBusiness("xiaoyan")
b.Bgs = 1
d,err := client.GetAudio(b,"这是一段合成的语音")
if err != nil {
log.Println(err)
}
ioutil.WriteFile("audio.pac",d.Bytes(),0664)
}
This package is released under GPLv3.