Skip to content

xiayesuifeng/go-xfyun-tts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-xfyun-tts

xfyun online tts binding for Go (Golang)

Go Report Card GoDoc Sourcegraph

Installation

go get -u gitlab.com/xiayesuifeng/go-xfyun-tts

Example Code

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)
}

License

This package is released under GPLv3.