flite

package module
v0.0.0-...-f4df211 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2017 License: BSD-3-Clause Imports: 3 Imported by: 1

README

flite-go GoDoc

Golang bindings for Flite (festival-lite)

Requirements

Ubuntu
apt-get install flite-dev
Fedora
dnf install flite-devel

Installation

go get -v github.com/gen2brain/flite-go

Example

package main

import "github.com/gen2brain/flite-go"

func main() {
	// The valid names are "awb", "kal16", "kal", "rms" and "slt"
	voice, err := flite.VoiceSelect("kal")
	if err != nil {
		panic(err)
	}

    	// Use "play" for output and it will be sent to the audio device
	flite.TextToSpeech("Hello World", voice, "output.wav")
}

Documentation

Overview

Package flite implements bindings for Flite (festival-lite)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TextToSpeech

func TextToSpeech(text string, voice *Voice, outtype string) float64

TextToSpeech synthesizes the text with the given voice. outtype may be a filename where the generated wav is written to, or "play" and it will be sent to the audio device, or "none" and it will be discarded. The return value is the number of seconds of speech generated.

Types

type Voice

type Voice struct {
	// contains filtered or unexported fields
}

Voice type

func VoiceSelect

func VoiceSelect(name string) (*Voice, error)

VoiceSelect returns a Voice for the voice name. The valid names are "awb", "kal16", "kal", "rms", "slt". It will return error if there is no match.

type Wave

type Wave struct {
	Type        *int8
	SampleRate  int32
	NumSamples  int32
	NumChannels int32
	Padding     [4]byte
	Samples     *int16
}

Wave type

func TextToWave

func TextToWave(text string, voice *Voice) *Wave

TextToWave returns a waveform synthesized from the text with the given voice.

Directories

Path Synopsis
cmd
say

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL