This commit is contained in:
邹宗楠
2022-07-27 18:45:42 +08:00
parent c7ef385ba0
commit fc56434e55
2 changed files with 29 additions and 1 deletions

View File

@@ -498,7 +498,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
}
}
result = strings.ReplaceAll(result, sound, "")
result = strings.ReplaceAll(result, byteSignSound, hexSignSoundSolidification+voice)
result = strings.ReplaceAll(result, byteSignSound, voice)
}
}
// 自动合成语音功能

View File

@@ -6,6 +6,7 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model"
"strconv"
"strings"
"testing"
)
@@ -56,3 +57,30 @@ func TestCheckSum(t *testing.T) {
}
fmt.Println("==========", int16Sound)
}
func TestTen216(t *testing.T) {
fmt.Println(toHex(16))
}
func toHex(ten int) string {
m := 0
hex := make([]int, 0)
for {
m = ten % 16
ten = ten / 16
if ten == 0 {
hex = append(hex, m)
break
}
hex = append(hex, m)
}
hexStr := []string{}
for i := len(hex) - 1; i >= 0; i-- {
if hex[i] >= 10 {
hexStr = append(hexStr, fmt.Sprintf("%c", 'A'+hex[i]-10))
} else {
hexStr = append(hexStr, fmt.Sprintf("%d", hex[i]))
}
}
return strings.Join(hexStr, "")
}