You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
327 B
21 lines
327 B
1 year ago
|
package tts
|
||
|
|
||
|
import "os"
|
||
|
|
||
|
type Piper struct {
|
||
|
assetDir string
|
||
|
}
|
||
|
|
||
|
func New(assetDir string) (*Piper, error) {
|
||
|
if _, err := os.Stat(assetDir); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &Piper{
|
||
|
assetDir: assetDir,
|
||
|
}, nil
|
||
|
}
|
||
|
|
||
|
func (s *Piper) TTS(text, model, dst string) error {
|
||
|
return tts(text, model, s.assetDir, "", dst)
|
||
|
}
|