From 6f8ab0e223f491ed042dd647781443c22cef29dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=89ric=20Piel?= Date: Mon, 22 Oct 2012 15:07:32 +0100 Subject: [PATCH] demo/aout: support also samples with only one channel scipy.io.wavfile returns a one dimension array if the wav file is only one channel --- doc/demo/aout.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/demo/aout.py b/doc/demo/aout.py index 7e74f3a..348c762 100755 --- a/doc/demo/aout.py +++ b/doc/demo/aout.py @@ -156,6 +156,8 @@ def run(filename, subdevice, channels, range, aref, mmap=False, files=[]): range=range, aref=aref) for filename in files: frequency,unit_output_signal = load(filename=filename) + if len(unit_output_signal.shape) == 1: + unit_output_signal.shape = (unit_output_signal.shape[0], 1) output_buffer = generate_output_buffer( ao_subdevice, ao_channels, unit_output_signal) setup_command(ao_subdevice, ao_channels, frequency, output_buffer) -- 2.26.2