修改语音指令
This commit is contained in:
@@ -68,7 +68,6 @@ const (
|
||||
hexSignQr = "1b5a000106" // "1b5a000106" 0600 : 后面二维码的字节数
|
||||
hexSignQrEnd = "000a1b40" // 000a0a0a1b40
|
||||
hexSignSound = "1d6b40" // 音频指令
|
||||
hexSignSoundOld = "1B594155" // 音频指令(老指令)
|
||||
|
||||
//起始标签 -- 自定义标签utf8转码为gbk字符集
|
||||
byteSignBR = "3c62723e" // 换行
|
||||
@@ -510,9 +509,10 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
//voiceData := hex.EncodeToString(voiceDataGBK)
|
||||
|
||||
//[8]sounda14 ->5b385d736f756e64613134
|
||||
//realSound := hexPrefixStr + voiceData
|
||||
//realSound := voiceData
|
||||
//allLen := fmt.Sprintf("%x", (len(realSound))/2)
|
||||
//hexPrefix, _ := jxutils.Utf8ToGbk([]byte(soundPrefix))
|
||||
//hexPrefixStr := hex.EncodeToString(hexPrefix)
|
||||
//realSound := hexPrefixStr + sound
|
||||
//allLen := fmt.Sprintf("%x", (len("fd001a0101")+len(realSound))/2)
|
||||
//if len(allLen) < 2 {
|
||||
// allLen = "0" + allLen
|
||||
//}
|
||||
@@ -520,7 +520,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
//soundLenH, soundLenX := int2h8l8(int64((len(realSound) + len("0101")) / 2))
|
||||
//result = strings.ReplaceAll(result, byteSignSound, hexSignSound+allLen+"fd"+soundLenH+soundLenX+"0100"+hexPrefixStr)
|
||||
result = strings.ReplaceAll(result, sound, "")
|
||||
result = strings.ReplaceAll(result, byteSignSound, hexSignSoundOld+voice)
|
||||
result = strings.ReplaceAll(result, byteSignSound, hexSignSound+voice)
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user