From 1bb4299913acb1a529c065f5b200e1f46dc4ab7f Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 3 Mar 2010 11:04:25 +0000 Subject: [PATCH] tests/api/gstreamer.py: use actual number of channels to convert buffer --- tests/api/gstreamer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/api/gstreamer.py b/tests/api/gstreamer.py index 82f03ff..897ac42 100644 --- a/tests/api/gstreamer.py +++ b/tests/api/gstreamer.py @@ -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 -- 2.39.5