修改语音配置
This commit is contained in:
@@ -482,9 +482,9 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
result = strings.ReplaceAll(result, byteSignQrRight, hexSignQrRight+hexSignQr+hexLenqr+"00")
|
||||
result = strings.ReplaceAll(result, byteSignQrRightE, hexSignQrEnd)
|
||||
}
|
||||
// 固定模板输出语音 3c736f756e643e<sound> 3634 </sound>3c2f736f756e643e
|
||||
// 固定模板输出语音
|
||||
if strings.Contains(result, byteSignSound) && strings.Contains(result, byteSignSoundE) {
|
||||
soundStr := ""
|
||||
var soundStr []string
|
||||
for _, v1 := range strings.Split(result, byteSignSoundE) {
|
||||
v1 += byteSignSoundE
|
||||
if sounds := regexpSound.FindStringSubmatch(v1); len(sounds) > 0 {
|
||||
@@ -505,10 +505,17 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
}
|
||||
}
|
||||
soundParam := strings.ReplaceAll(resultV1, sound, "")
|
||||
soundStr += strings.ReplaceAll(soundParam, byteSignSound, voice)
|
||||
soundStr = append(soundStr, strings.ReplaceAll(soundParam, byteSignSound, voice))
|
||||
}
|
||||
}
|
||||
result = soundStr
|
||||
|
||||
result = strings.ReplaceAll(result, byteSignSound, "*")
|
||||
result = strings.ReplaceAll(result, byteSignSoundE, "&")
|
||||
for _, v := range soundStr {
|
||||
start := strings.Index(result, "*")
|
||||
end := strings.Index(result, "&")
|
||||
result = strings.Replace(result, result[start:end+1], v, 1)
|
||||
}
|
||||
}
|
||||
// 自动合成语音功能
|
||||
//if strings.Contains(result, byteSignSound) && strings.Contains(result, byteSignSoundE) {
|
||||
@@ -566,8 +573,8 @@ func int2h8l8(i int64) (h, l string) {
|
||||
}
|
||||
begin8 := origin2[:8]
|
||||
end8 := origin2[8:]
|
||||
r1, _ := strconv.ParseInt(begin8, 2, 64)
|
||||
r2, _ := strconv.ParseInt(end8, 2, 64)
|
||||
r1, _ := strconv.ParseInt(begin8, 2, 32)
|
||||
r2, _ := strconv.ParseInt(end8, 2, 32)
|
||||
h = fmt.Sprintf("%x", r1)
|
||||
l = fmt.Sprintf("%x", r2)
|
||||
if len(h)%2 != 0 {
|
||||
|
||||
Reference in New Issue
Block a user