From 8fc8450fb36111713274d0c4375b9a4c63647521 Mon Sep 17 00:00:00 2001 From: May <675341471@qq.com> Date: Fri, 24 Jan 2025 16:00:24 +0800 Subject: [PATCH] Update HandleAudio.py __splitBufDataAndCreateDataHeader__ dataListLen should multiply self.channel --- auto_cut_audio/HandleAudio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_cut_audio/HandleAudio.py b/auto_cut_audio/HandleAudio.py index 229f068..bb3bbaf 100644 --- a/auto_cut_audio/HandleAudio.py +++ b/auto_cut_audio/HandleAudio.py @@ -328,7 +328,7 @@ def __splitBufDataAndCreateDataHeader__(self, startValue, end): buf = self.__getAudioBuf__() data = buf[startValue:end] # 对于数据计数是以字节计数,一个buf占两个字节,需要计数i, - dataListLen = (data.__len__() - 1) * 2 + dataListLen = (data.__len__() - 1) * 2 * self.channel dataLen = dataListLen.to_bytes(4, byteorder='little') fileLen = (dataListLen + header_bit).to_bytes(4, byteorder='little') header = info[0:4] + fileLen + info[8:header_bit - 4] + dataLen