Bugfix, actually explode the array for proper struct encoding
authorjweigele <jweigele@local>
Thu, 29 Sep 2022 22:20:20 +0000 (15:20 -0700)
committerjweigele <jweigele@local>
Thu, 29 Sep 2022 22:20:20 +0000 (15:20 -0700)
ffmpegfile.py

index b77948b55bf63b42c9fab52cd11df912736dce79..4bfe8d73ba50c6bac31ff1d712f6f5fd83cb342e 100644 (file)
@@ -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):