-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathast_test.go
More file actions
37 lines (35 loc) · 997 Bytes
/
ast_test.go
File metadata and controls
37 lines (35 loc) · 997 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
31
32
33
34
35
36
37
package iflytek_test
import (
dgctx "github.com/darwinOrg/go-common/context"
dgkdxf "github.com/darwinOrg/go-iflytek"
dglogger "github.com/darwinOrg/go-logger"
"os"
"testing"
)
func TestBuildAstUri(t *testing.T) {
host := "wss://api.iflyrec.com"
appId := os.Getenv("appId")
accessKeyId := os.Getenv("accessKeyId")
accessKeySecret := os.Getenv("accessKeySecret")
ctx := &dgctx.DgContext{TraceId: "123"}
client := dgkdxf.NewClient(&dgkdxf.ClientConfig{
AppId: appId,
Host: host,
AccessKeyId: accessKeyId,
AccessKeySecret: accessKeySecret,
})
uri := client.BuildAstUri(ctx, &dgkdxf.AstParamConfig{
Lang: "cn",
Codec: "pcm_s16le",
AudioEncode: "pcm",
Samplerate: "16000",
RoleType: dgkdxf.RoleTypeOpen,
ContextId: "",
FeatureIds: "20231130092311300926BB8003FA00000",
HotWordId: "",
SourceInfo: "",
FilePath: "",
ResultFilePath: "",
})
dglogger.Infof(ctx, "uri: %s", uri)
}