2 Commits

Author SHA1 Message Date
fzqxzhang
261398509a feat: model_id tag add omitempty (#3) 2023-07-25 15:43:48 +00:00
Marcel Molina
b925ef1471 Fix compile error from variable typo (#2)
* Fix compile error from variable typo

* bytes.Buffer pointer
2023-07-09 16:00:45 +00:00
2 changed files with 2 additions and 2 deletions

View File

@@ -83,7 +83,7 @@ func (c Client) TTS(ctx context.Context, text, voiceID, modelID string, options
b := bytes.Buffer{} b := bytes.Buffer{}
defer res.Body.Close() defer res.Body.Close()
io.Copy(w, res.Body) io.Copy(&b, res.Body)
return b.Bytes(), nil return b.Bytes(), nil
case 422: case 422:
fallthrough fallthrough

View File

@@ -19,7 +19,7 @@ type Voice struct {
Labels string `json:"labels,omitempty"` // Serialized labels dictionary for the voice. Labels string `json:"labels,omitempty"` // Serialized labels dictionary for the voice.
} }
type TTS struct { type TTS struct {
ModelID string `json:"model_id"` ModelID string `json:"model_id,omitempty"`
Text string `json:"text"` // The text that will get converted into speech. Currently only English text is supported. Text string `json:"text"` // The text that will get converted into speech. Currently only English text is supported.
VoiceSettings SynthesisOptions `json:"voice_settings,omitempty"` // Voice settings are applied only on the given TTS request. VoiceSettings SynthesisOptions `json:"voice_settings,omitempty"` // Voice settings are applied only on the given TTS request.
} }