修改音频补位
This commit is contained in:
@@ -37,6 +37,9 @@ const (
|
||||
printerStatusOnlineWithoutPaper = 2 //在线缺纸
|
||||
printerStatusOnline = 1 //在线
|
||||
printerStatusOffline = -1 //离线
|
||||
|
||||
PrintSoundMaxNumber = 16 // 十六进制最大补位
|
||||
PlaceFillingParam = "0" // 补位参数
|
||||
)
|
||||
|
||||
//标签
|
||||
@@ -487,7 +490,11 @@ func replaceContent(content string, printMsg *model.PrintMsg) (result string) {
|
||||
soundNum, _ := hex.DecodeString(v) // 十六进制转字符串
|
||||
intSound, _ := strconv.ParseInt(string(soundNum), 10, 64)
|
||||
int16Sound := strconv.FormatInt(intSound, 16)
|
||||
voice += int16Sound
|
||||
if intSound < PrintSoundMaxNumber { // 小于十六补位
|
||||
voice += PlaceFillingParam + int16Sound
|
||||
} else {
|
||||
voice += int16Sound
|
||||
}
|
||||
}
|
||||
result = strings.ReplaceAll(result, sound, "")
|
||||
result = strings.ReplaceAll(result, byteSignSound, hexSignSoundSolidification+voice)
|
||||
|
||||
Reference in New Issue
Block a user