Pika TTS is a small, local text to speech voice synthesizer package based on the SVox Pico library included in Android AOSP
A sample is available in testdata/sample.wav
import (
"github.com/amitybell/pikatts"
"log"
)
func main() {
eng, err := pikatts.New(pikatts.British)
if err != nil {
log.Fatalln("Failed to create TTS engine:", err)
}
defer eng.Close()
wav, err := eng.Synthesize("hello world")
if err != nil {
log.Fatalln("Failed synthesize text:", err)
}
// Do something with `wav`
_ = wav
}
This package deals solely with text-to-speech synthesizing. Other packages can be used to further process or play the generated audio.