1
This commit is contained in:
@@ -498,7 +498,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = strings.ReplaceAll(result, sound, "")
|
result = strings.ReplaceAll(result, sound, "")
|
||||||
result = strings.ReplaceAll(result, byteSignSound, hexSignSoundSolidification+voice)
|
result = strings.ReplaceAll(result, byteSignSound, voice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 自动合成语音功能
|
// 自动合成语音功能
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -56,3 +57,30 @@ func TestCheckSum(t *testing.T) {
|
|||||||
}
|
}
|
||||||
fmt.Println("==========", int16Sound)
|
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, "")
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user