mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-18 16:50:14 -07:00
fix: check return code of Google TTS
This commit is contained in:
parent
3e2303ad66
commit
837196dbd4
@ -130,6 +130,9 @@ func (t *Translator) PlayTTS(lang, message string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if res.StatusCode == 400 {
|
||||
return errors.New(t.GetEngineName() + " does not support text to speech of " + lang)
|
||||
}
|
||||
decoder, err := mp3.NewDecoder(res.Body)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user