修改语音
This commit is contained in:
@@ -484,7 +484,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
|||||||
//printer.Sound = "sounda"
|
//printer.Sound = "sounda"
|
||||||
//if printer, _ := dao.GetPrinter(dao.GetDB(), printMsg.PrintNo); printer != nil {
|
//if printer, _ := dao.GetPrinter(dao.GetDB(), printMsg.PrintNo); printer != nil {
|
||||||
//先把结束标签消了
|
//先把结束标签消了
|
||||||
result = strings.ReplaceAll(result, byteSignSoundE, "")
|
result = strings.ReplaceAll(result, byteSignSoundE, "") // 3c736f756e643e 3230 3c736f756e643e
|
||||||
//fd 固定
|
//fd 固定
|
||||||
//001a (声音数据长度高八位低八位)
|
//001a (声音数据长度高八位低八位)
|
||||||
//0101 固定
|
//0101 固定
|
||||||
@@ -505,6 +505,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
|||||||
int16Sound := strconv.FormatInt(intSound, 16)
|
int16Sound := strconv.FormatInt(intSound, 16)
|
||||||
voice += int16Sound
|
voice += int16Sound
|
||||||
}
|
}
|
||||||
|
fmt.Println("voice=========", voice)
|
||||||
//voiceDataGBK, _ := jxutils.Utf8ToGbk([]byte(voice))
|
//voiceDataGBK, _ := jxutils.Utf8ToGbk([]byte(voice))
|
||||||
//voiceData := hex.EncodeToString(voiceDataGBK)
|
//voiceData := hex.EncodeToString(voiceDataGBK)
|
||||||
|
|
||||||
@@ -518,6 +519,7 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
|||||||
|
|
||||||
//soundLenH, soundLenX := int2h8l8(int64((len(realSound) + len("0101")) / 2))
|
//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, 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, hexSignSoundOld+voice)
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user