Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.36 KB

README.md

File metadata and controls

54 lines (38 loc) · 1.36 KB

CereVoice Go

CereVoice Go is a Go package for accessing the CereProc CereVoice Cloud API. Currently this package implements all available functions using the REST API. SOAP has not yet been implemented.

Notice

Please note that is package is not complete and is considered pre-release, meaning it is subject to change. Safety not guaranteed.

Usage

Assuming you have Go already setup and working, grab the latest version of the package from master.

go get github.com/bganderson/cerevoicego

Import the package into your project.

import "github.com/bganderson/cerevoicego"

Create a cerevoice client. Please note that AccountID and Password are not the same credentials you use to login to the website.

For the REST API URL you can use the exported const provided by the package.

cerevoice := cerevoicego.Client{
    CereVoiceAPIURL: cerevoicego.DefaultRESTAPIURL,
    AccountID:       "<YOUR_ACCOUNTID>",
    Password:        "<YOUR_PASSWORD",
}

Make an API request and do something with the response.

res := cerevoice.SpeakSimple(&cerevoicego.SpeakSimpleInput{
    Voice: "Jess",
    Text:  "Hello world!",
})
if res.Error != nil {
    log.Fatalln(res.Error)
}

fmt.Printf("The sound file is available at: %s\n", res.FileURL)