]> git.parisson.com Git - timeside.git/commitdiff
rely on ndarray.ndim for decoder reshaping
authorOlivier Guilyardi <olivier@samalyse.com>
Wed, 17 Feb 2010 23:20:29 +0000 (23:20 +0000)
committerOlivier Guilyardi <olivier@samalyse.com>
Wed, 17 Feb 2010 23:20:29 +0000 (23:20 +0000)
tests/api/examples.py

index ae1a64a10f44bcb471fbd2b64466f84a19f2529d..5d8fe7cfdbfc2c72a7f6af0a0a93b1bc36720004 100644 (file)
@@ -93,7 +93,7 @@ class FileDecoder(Processor):
         self.position += toread
 
         # audiolab returns a 1D array for 1 channel, need to reshape to 2D: 
-        if self.file.channels == 1:
+        if frames.ndim == 1:
             frames = frames.reshape(len(frames), 1)
 
         return frames, eod