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