-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
90 lines (63 loc) · 2.05 KB
/
main.go
File metadata and controls
90 lines (63 loc) · 2.05 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package main
import (
"log"
"github.com/coderguang/GameEngine_go/sgfile"
"github.com/coderguang/GameEngine_go/sglog"
"github.com/coderguang/GameEngine_go/sgthread"
"github.com/coderguang/GameEngine_go/sgtts/wordToVoice"
"github.com/coderguang/GameEngine_go/sgcfg"
"github.com/coderguang/GameEngine_go/sgcmd"
"github.com/coderguang/GameEngine_go/sgserver"
)
//var wg sync.WaitGroup
func main() {
sgcfg.SetServerCfgDir("./../../globalConfig/server_config/")
// defer func() {
// if r := recover(); r != nil {
// log.Println("recover from addServerToList,", r)
// }
// }()
//sgtime.InitTimeLocation("America/Los_Angeles")
//sgserver.StartLogServer("debug", "./log/", log.LstdFlags, true)
sgserver.StartServer(sgserver.ServerTypeLog, "debug", "./../log/", log.LstdFlags, true)
//sgserver.StartServer(sgserver.ServerTypeMail)
param := wordToVoice.NewParam()
voiceBytes, err := wordToVoice.WorldToVoice("简单测试", "wss://tts-api.xfyun.cn/v2/tts", "app_id", "apikey", "apsec", param)
if err != nil {
sglog.Info("world to voice error")
sgthread.SleepBySecond(2)
}
num, filename, err := sgfile.WriteFile("./data/", "tmp.mp3", voiceBytes)
if err != nil {
sglog.Error("write file error", err)
sgthread.SleepBySecond(2)
}
sglog.Debug("write file ok,num:", num, filename)
sgthread.SleepBySecond(2)
// tolist := []string{"royalchen@royalchen.com"}
// for i := 0; i < 1; i++ {
// sgmail.SendMail("GameEngine_go", tolist, "mail from GameEngine go")
// sgthread.SleepBySecond(10)
// }
//sgserver.StartServer(sgserver.ServerTypeLog, "debug", "./../log/", log.LstdFlags, "wtwer")
// for {
// sglog.Info("test data")
// sgthread.SleepBySecond(3)
// }
// for i := 0; i < 10; i++ {
// //wg.Add(1)
// go func() {
// for {
// sglog.Info("this is test stt")
// sgthread.SleepByMillSecond(10)
// }
// }()
// }
// result, err := sgwhois.GetWhoisInfo("baidu.cn")
// if err != nil {
// sglog.Error("parse error")
// }
// sgwhois.ParseWhois(result)
//sgwhois.ShowWhoisInfo(result)
sgcmd.StartCmdWaitInputLoop()
}