Add Go API for Kokoro TTS 1.0 (#1804)
This commit is contained in:
1
scripts/go/_internal/non-streaming-tts/run-kokoro-zh-en.sh
Symbolic link
1
scripts/go/_internal/non-streaming-tts/run-kokoro-zh-en.sh
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../go-api-examples/non-streaming-tts/run-kokoro-zh-en.sh
|
||||
@@ -687,6 +687,8 @@ type OfflineTtsKokoroModelConfig struct {
|
||||
Voices string // Path to the voices.bin for kokoro
|
||||
Tokens string // Path to tokens.txt
|
||||
DataDir string // Path to espeak-ng-data directory
|
||||
DictDir string // Path to dict directory
|
||||
Lexicon string // Path to lexicon files
|
||||
LengthScale float32 // Please use 1.0 in general. Smaller -> Faster speech speed. Larger -> Slower speech speed
|
||||
}
|
||||
|
||||
@@ -798,6 +800,12 @@ func NewOfflineTts(config *OfflineTtsConfig) *OfflineTts {
|
||||
c.model.kokoro.data_dir = C.CString(config.Model.Kokoro.DataDir)
|
||||
defer C.free(unsafe.Pointer(c.model.kokoro.data_dir))
|
||||
|
||||
c.model.kokoro.dict_dir = C.CString(config.Model.Kokoro.DictDir)
|
||||
defer C.free(unsafe.Pointer(c.model.kokoro.dict_dir))
|
||||
|
||||
c.model.kokoro.lexicon = C.CString(config.Model.Kokoro.Lexicon)
|
||||
defer C.free(unsafe.Pointer(c.model.kokoro.lexicon))
|
||||
|
||||
c.model.kokoro.length_scale = C.float(config.Model.Kokoro.LengthScale)
|
||||
|
||||
c.model.num_threads = C.int(config.Model.NumThreads)
|
||||
|
||||
Reference in New Issue
Block a user