提交数据
This commit is contained in:
@@ -492,8 +492,6 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
v1 += byteSignSoundE
|
||||
if sounds := regexpSound.FindStringSubmatch(v1); len(sounds) > 0 {
|
||||
sound := sounds[1]
|
||||
//先把结束标签消了
|
||||
resultV1 := strings.ReplaceAll(v1, byteSignSoundE, "")
|
||||
// 将语音包转换为十六进制
|
||||
voice := ""
|
||||
for _, v := range strings.Split(sound, "2c") {
|
||||
@@ -507,17 +505,17 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
voice += int16Sound
|
||||
}
|
||||
}
|
||||
soundParam := strings.ReplaceAll(resultV1, sound, "")
|
||||
soundStr = append(soundStr, strings.ReplaceAll(soundParam, byteSignSound, voice))
|
||||
soundStr = append(soundStr, voice)
|
||||
}
|
||||
}
|
||||
|
||||
result = strings.ReplaceAll(result, byteSignSound, "*")
|
||||
result = strings.ReplaceAll(result, byteSignSoundE, "&")
|
||||
for _, v := range soundStr {
|
||||
for i := 0; i < len(soundStr); i++ {
|
||||
fmt.Println("result=", result)
|
||||
start := strings.Index(result, "*")
|
||||
end := strings.Index(result, "&")
|
||||
result = strings.Replace(result, result[start:end+1], v, 1)
|
||||
result = strings.Replace(result, result[start:end+1], soundStr[i], 1)
|
||||
}
|
||||
}
|
||||
// 自动合成语音功能
|
||||
|
||||
Reference in New Issue
Block a user