aa
This commit is contained in:
@@ -470,8 +470,13 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
//fd 固定
|
||||
//001a (声音数据长度高八位低八位)
|
||||
//0101 固定
|
||||
soundPerfix := "[v" + utils.Int2Str(printer.Volume*2) + "]" + printer.Sound + ","
|
||||
hexPrefix, _ := jxutils.Utf8ToGbk([]byte(soundPerfix))
|
||||
soundPrefix := ""
|
||||
if printer.Sound != "" {
|
||||
soundPrefix = "[v" + utils.Int2Str(printer.Volume*2) + "]" + printer.Sound + ","
|
||||
} else {
|
||||
soundPrefix = "[v" + utils.Int2Str(printer.Volume*2) + "]"
|
||||
}
|
||||
hexPrefix, _ := jxutils.Utf8ToGbk([]byte(soundPrefix))
|
||||
hexPrefixStr := hex.EncodeToString(hexPrefix)
|
||||
realSound := hexPrefixStr + sound
|
||||
allLen := fmt.Sprintf("%x", (len("fd001a0101")+len(realSound))/2)
|
||||
|
||||
Reference in New Issue
Block a user