From: Éric Piel Date: Mon, 22 Oct 2012 14:07:32 +0000 (+0100) Subject: demo/aout: support also samples with only one channel X-Git-Tag: 0.6~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6f8ab0e223f491ed042dd647781443c22cef29dc;p=pycomedi.git 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 --- 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)