From 62f8ee1a4bfe1592989f59513f63cb8fc8c7d09d Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 10 Jan 2021 11:01:01 +0800 Subject: [PATCH] tts bug --- README.md | 2 +- Reply/F.go | 2 +- Reply/gtk.go | 4 ++++ Reply/tts.go | 6 +++++- Send/README.md | 2 +- demo/config/config_tts.json | 1 - demo/go.mod | 4 ++-- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 959e50b..d7f9a25 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ golang go version go1.15 linux/amd64 |CV/|全局变常量| |F/|项目小工具(ws消息生成、api、整数字节转换)| |Replay/|接收的数据处理区| -|Send/|弹幕发送| +|Send/|发送数据区| |_Screenshot/|截图保存目录| |_msg_sample/|ws接收数据示例| |_source/|bilijs文件示例| diff --git a/Reply/F.go b/Reply/F.go index d869162..2563209 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -342,7 +342,7 @@ func Obsf(on bool){ return } l.I("启动obs") - p.Exec().Startf(exec.Command(obs.Prog)) + p.Exec().Start(exec.Command(obs.Prog)) p.Sys().Timeoutf(3) } diff --git a/Reply/gtk.go b/Reply/gtk.go index dd2ed54..e384dc7 100644 --- a/Reply/gtk.go +++ b/Reply/gtk.go @@ -600,6 +600,10 @@ func load_face(uid string) (loc string) { return } if gtkGetList.Len() > 1000 {return} + //加入前先行检查 + for v := gtkGetList.Front();v != nil;v = v.Next() { + if v.Value.(string) == uid {return} + } gtkGetList.PushBack(uid) return } \ No newline at end of file diff --git a/Reply/tts.go b/Reply/tts.go index 70d2436..684a0db 100644 --- a/Reply/tts.go +++ b/Reply/tts.go @@ -3,6 +3,7 @@ package reply import ( + "os/exec" "net/url" "strings" p "github.com/qydysky/part" @@ -46,6 +47,9 @@ func init(){ } } } + //启动程序 + p.Exec().Start(exec.Command(tts_prog)) + go func(){ for{ e := <- tts_List @@ -86,6 +90,6 @@ func TTS(uid,msg string) { var prog = []string{} prog = append(prog, p.Sys().Cdir()+"/tts.mp3") prog = append(prog, strings.Split(tts_prog_set," ")...) - p.Exec().Run(false, tts_prog, prog...) + p.Exec().Start(exec.Command(tts_prog, prog...)) return } \ No newline at end of file diff --git a/Send/README.md b/Send/README.md index 57d8724..60f1f2c 100644 --- a/Send/README.md +++ b/Send/README.md @@ -3,7 +3,7 @@ ### 目录释义 |目录|说明| |-|-| -|./|弹幕发送| +|./|发送数据区| |Send.go|弹幕发送| |Send_pm.go|私信发送| --- \ No newline at end of file diff --git a/demo/config/config_tts.json b/demo/config/config_tts.json index 3c0a36d..dfaf7ca 100644 --- a/demo/config/config_tts.json +++ b/demo/config/config_tts.json @@ -3,6 +3,5 @@ "0gift": "感谢{D}", "0superchat": "感谢{D}", "0multi": "观众:{D}", - "0room": "{D}", "0rank":"{D}" } \ No newline at end of file diff --git a/demo/go.mod b/demo/go.mod index 01265da..9e83cc3 100644 --- a/demo/go.mod +++ b/demo/go.mod @@ -11,7 +11,7 @@ require ( github.com/miekg/dns v1.1.35 // indirect github.com/mitchellh/mapstructure v1.4.0 // indirect github.com/qydysky/bili_danmu v0.5.7 - github.com/qydysky/part v0.3.5-0.20210106133414-a27e61b5ba4b // indirect + github.com/qydysky/part v0.3.5-0.20210110025721-48b2732f9fb8 // indirect github.com/shirou/gopsutil v3.20.12+incompatible // indirect github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect @@ -22,5 +22,5 @@ require ( replace ( github.com/gotk3/gotk3 v0.5.2 => github.com/qydysky/gotk3 v0.0.0-20210103171910-327affdaaa80 github.com/qydysky/bili_danmu => ../ -//github.com/qydysky/part => ../../part + //github.com/qydysky/part => ../../part ) -- 2.39.2