mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-17 16:20:33 -07:00
27 lines
527 B
Go
27 lines
527 B
Go
package libretranslate
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
const (
|
|
ttsURL = "https://translate.google.com.vn/translate_tts?ie=UTF-8&q=%s&tl=%s&client=tw-ob"
|
|
)
|
|
|
|
func (t *LibreTranslate) LockAvailable() bool {
|
|
return t.SoundLock.Available()
|
|
}
|
|
|
|
func (t *LibreTranslate) LockAcquire() {
|
|
t.SoundLock.Acquire()
|
|
}
|
|
|
|
func (t *LibreTranslate) StopTTS() {
|
|
t.SoundLock.Stop = true
|
|
}
|
|
|
|
func (t *LibreTranslate) PlayTTS(lang string, message string) error {
|
|
t.SoundLock.Release()
|
|
return errors.New("LibreTranslate does not support text to speech")
|
|
}
|