-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patht2a_test.go
45 lines (40 loc) · 910 Bytes
/
t2a_test.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package minimax_test
import (
"context"
"fmt"
"os"
"testing"
"github.com/Twacqwq/go-minimax"
)
func TestTextToSpeech(t *testing.T) {
client := minimax.NewClient(os.Getenv("TOKEN"), os.Getenv("GROUPID"))
resp, err := client.CreateTextToSpeech(context.Background(), &minimax.CreateT2ARequest{
VoiceId: "female-yujie",
Text: "hello",
Path: "./",
Name: "hello.mp3",
TimberWeights: []minimax.TimberWeight{
{
VoiceId: "female-yujie",
Weight: 1,
},
},
})
if err != nil {
t.Log(err.Error())
return
}
fmt.Printf("%#v\n", resp)
}
func TestTextToSpeechPro(t *testing.T) {
client := minimax.NewClient(os.Getenv("TOKEN"), os.Getenv("GROUPID"))
resp, err := client.CreateTextToSpeechPro(context.Background(), &minimax.CreateT2ARequest{
Text: "hello",
VoiceId: "female-yujie",
})
if err != nil {
t.Log(err.Error())
return
}
fmt.Printf("%#v\n", resp)
}