Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ModelToURL = map[string]string{
"en_US-hfc_male-medium.onnx": "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/hfc_male/medium/en_US-hfc_male-medium.onnx",
"en_US-hfc_female-medium.onnx": "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/hfc_female/medium/en_US-hfc_female-medium.onnx",
"en_US-lessac-medium.onnx": "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/lessac/medium/en_US-lessac-medium.onnx",
"en_GB-northern_english_male-medium.onnx": "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/northern_english_male/medium/en_GB-northern_english_male-medium.onnx",
"zh_CN-huayan-medium.onnx": "https://huggingface.co/rhasspy/piper-voices/resolve/main/zh/zh_CN/huayan/medium/zh_CN-huayan-medium.onnx",
}
Piper has hundreds of pretrained models on the sample Website These are some of the best ones for English. However, as long as you have both the .onnx and .onnx.json files locally, you can use any model you want or even train your own.
Functions ¶
func FindModels ¶
Types ¶
type PiperClient ¶
type PiperClient struct {
// contains filtered or unexported fields
}
func NewPiperClient ¶
func NewPiperClient(model string) (*PiperClient, error)
func (PiperClient) Run ¶
func (p PiperClient) Run(filename string, inputData io.Reader, outdir string, streamOutput bool) (bin.PipedOutput, string, error)
Run calls piper with the given model, using inputData as the text to be spoken.
If streamOutput == true, it returns a PipedOutput so the caller can read raw PCM from output.Stdout.
If streamOutput == false, we wait for piper to finish writing a .wav file and run the name of the .wav file as the output.
We log all of piper's stderr so that if there's an error, we see it.
Click to show internal directories.
Click to hide internal directories.