forked from neosapience/cast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtts.go
More file actions
30 lines (26 loc) · 1012 Bytes
/
tts.go
File metadata and controls
30 lines (26 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package client
type TTSRequest struct {
VoiceID string `json:"voice_id"`
Text string `json:"text"`
Model string `json:"model"`
Language string `json:"language,omitempty"`
Prompt *TTSPrompt `json:"prompt,omitempty"`
Output *TTSOutput `json:"output,omitempty"`
Seed *int `json:"seed,omitempty"`
}
type TTSPrompt struct {
EmotionType string `json:"emotion_type,omitempty"`
EmotionPreset string `json:"emotion_preset,omitempty"`
EmotionIntensity *float64 `json:"emotion_intensity,omitempty"`
PreviousText string `json:"previous_text,omitempty"`
NextText string `json:"next_text,omitempty"`
}
type TTSOutput struct {
Volume *int `json:"volume,omitempty"`
AudioPitch *int `json:"audio_pitch,omitempty"`
AudioTempo *float64 `json:"audio_tempo,omitempty"`
AudioFormat string `json:"audio_format,omitempty"`
}
func (c *Client) TextToSpeech(req TTSRequest) ([]byte, error) {
return c.post("/v1/text-to-speech", req)
}