This commit is contained in:
suyl
2021-08-04 15:11:12 +08:00
parent d2e06c0231
commit 2d75a94b24
2 changed files with 24 additions and 15 deletions

View File

@@ -11,6 +11,7 @@ import (
"net"
"strings"
"time"
"unicode/utf8"
)
//入口
@@ -245,6 +246,13 @@ func (t *TcpClient) doPrint(key string) (err error) {
dataStr := <-t.CallBackMap[printMsg.PrintNo]
a, b := getCallbackMsgInfo(dataStr)
t.changePrintMsg(dataStr, a, b)
//判断音频暂停?
//收到打印成功回调后,如果消息中有音频,需要等待一下
if sounds := regexpSoundSpan.FindStringSubmatch(printMsg.Content); len(sounds) > 0 {
sound := sounds[1]
lenTime := time.Duration(utf8.RuneCountInString(sound)) * time.Second
time.Sleep(lenTime)
}
}
}
}