From: Paul Brossier Date: Wed, 3 Mar 2010 11:04:25 +0000 (+0000) Subject: tests/api/gstreamer.py: use actual number of channels to convert buffer X-Git-Tag: 0.3.2~168 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=1bb4299913acb1a529c065f5b200e1f46dc4ab7f;p=timeside.git tests/api/gstreamer.py: use actual number of channels to convert buffer --- 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