语音暂停
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
//入口
|
//入口
|
||||||
@@ -254,13 +253,13 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
|||||||
//判断音频暂停?
|
//判断音频暂停?
|
||||||
//收到打印成功回调后,如果消息中有音频,需要等待一下,等上一个音频播完
|
//收到打印成功回调后,如果消息中有音频,需要等待一下,等上一个音频播完
|
||||||
//暂停时间就暂时取的sound标签内内容长度/2
|
//暂停时间就暂时取的sound标签内内容长度/2
|
||||||
if sounds := regexpSoundSpan.FindStringSubmatch(printMsg.Content); len(sounds) > 0 {
|
//if sounds := regexpSoundSpan.FindStringSubmatch(printMsg.Content); len(sounds) > 0 {
|
||||||
globals.SugarLogger.Debug("sound =====================", sounds)
|
// globals.SugarLogger.Debug("sound =====================", sounds)
|
||||||
sound := sounds[1]
|
// sound := sounds[1]
|
||||||
globals.SugarLogger.Debug("sound =====================", sound)
|
// globals.SugarLogger.Debug("sound =====================", sound)
|
||||||
lenTime := time.Duration(utf8.RuneCountInString(sound)) * time.Second
|
// lenTime := time.Duration(utf8.RuneCountInString(sound)) * time.Second
|
||||||
time.Sleep(lenTime / 2)
|
// time.Sleep(lenTime / 2)
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user