]> git.parisson.com Git - timeside.git/commitdiff
tests/api/gstreamer.py: use actual number of channels to convert buffer
authorPaul Brossier <piem@piem.org>
Wed, 3 Mar 2010 11:04:25 +0000 (11:04 +0000)
committerPaul Brossier <piem@piem.org>
Wed, 3 Mar 2010 11:04:25 +0000 (11:04 +0000)
tests/api/gstreamer.py

index 82f03ff5992b0fd81d9d6a681a288d384f9056bd..897ac4282d418cd33a12a1b2124f46d26116ebcd 100644 (file)
@@ -160,8 +160,9 @@ class FileDecoder(Processor):
             print "fail", path
         self.mainloop.quit()
 
-    def gst_buffer_to_numpy_array(self, buf, chan = 1):
+    def gst_buffer_to_numpy_array(self, buf):
         """ gstreamer buffer to numpy array conversion """
+        chan = self.audiochannels
         samples = frombuffer(buf.data, dtype=float32) 
         samples.resize([len(samples)/chan, chan])
         return samples