Documentation ¶
Overview ¶
Package gopicotts provides a wrapper around the pico text to speech engine.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultOptions = Options{ Language: LanguageEnUS, LanguageDir: "/usr/share/pico/lang/", }
Functions ¶
func SupportedLanguages ¶
func SupportedLanguages() []string
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
NewEngine creates a new Pico text to speech engine.
Example ¶
eng, err := gopicotts.NewEngine(gopicotts.DefaultOptions) defer eng.Close() if err != nil { log.Fatalf("error intializing engine: %s", err) } eng.SetFileOutput("output.wav") eng.SendText("hello world.") eng.CloseFileOutput()
Output:
func (*Engine) CloseFileOutput ¶
func (*Engine) FlushSendText ¶
FlushSendText flushes the Pico input buffer, which might be waiting on an end of sentence before producing speech.
func (*Engine) SendText ¶
SendText sends 'text' encoded in UTF8 into the Pico text input buffer. The input text may also contain text-input commands to change, for example, speed or pitch of the resulting speech output. Sentence ends are automatically detected.
func (*Engine) SetFileOutput ¶
SetFileOutput sets the output file for encoded speech. If the filename ends in .wav, it will be WAVE formatted, if it ends in .au, it will be .AU formatted, otherwise it will be raw headerless PCM audio.