From 461d0e5aaf963de822e22611683e43d1a7b4fcdc Mon Sep 17 00:00:00 2001 From: jweigele Date: Thu, 29 Sep 2022 15:20:20 -0700 Subject: [PATCH] Bugfix, actually explode the array for proper struct encoding --- ffmpegfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ffmpegfile.py b/ffmpegfile.py index b77948b..4bfe8d7 100644 --- a/ffmpegfile.py +++ b/ffmpegfile.py @@ -49,7 +49,8 @@ class AudioChunk(object): #log.debug(list(self.samples)) next_samples = 32768.0 * self.samples next_bytes = next_samples.astype('int16') - return struct.pack('<'+'h'*self.samples.size, next_bytes) + retval = struct.pack('<'+'h'*len(next_bytes), *list(next_bytes)) + return retval @property def length(self): -- 2.30.2