mirror of
https://github.com/taigrr/elevenlabs.git
synced 2026-04-02 03:08:57 -07:00
Merge branch 'master' of github.com:taigrr/elevenlabs
This commit is contained in:
@@ -13,11 +13,12 @@ import (
|
||||
"github.com/taigrr/elevenlabs/client/types"
|
||||
)
|
||||
|
||||
func (c Client) TTSWriter(ctx context.Context, w io.Writer, text, voiceID string, options types.SynthesisOptions) error {
|
||||
func (c Client) TTSWriter(ctx context.Context, w io.Writer, text, modelID, voiceID string, options types.SynthesisOptions) error {
|
||||
options.Clamp()
|
||||
url := fmt.Sprintf(c.endpoint+"/v1/text-to-speech/%s", voiceID)
|
||||
opts := types.TTS{
|
||||
Text: text,
|
||||
ModelID: modelID,
|
||||
VoiceSettings: options,
|
||||
}
|
||||
b, _ := json.Marshal(opts)
|
||||
@@ -55,12 +56,13 @@ func (c Client) TTSWriter(ctx context.Context, w io.Writer, text, voiceID string
|
||||
}
|
||||
}
|
||||
|
||||
func (c Client) TTS(ctx context.Context, text, voiceID string, options types.SynthesisOptions) ([]byte, error) {
|
||||
func (c Client) TTS(ctx context.Context, text, voiceID, modelID string, options types.SynthesisOptions) ([]byte, error) {
|
||||
options.Clamp()
|
||||
url := fmt.Sprintf(c.endpoint+"/v1/text-to-speech/%s", voiceID)
|
||||
client := &http.Client{}
|
||||
opts := types.TTS{
|
||||
Text: text,
|
||||
ModelID: modelID,
|
||||
VoiceSettings: options,
|
||||
}
|
||||
b, _ := json.Marshal(opts)
|
||||
|
||||
Reference in New Issue
Block a user