From: Thomas Fillon Date: Tue, 11 Mar 2014 16:43:06 +0000 (+0100) Subject: ArrayDecoder: Convert array to 'float32' for compatibility with FileDecoder + add... X-Git-Tag: 0.5.5~3^2^2~18 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=37e99837fe8d762c7d69cc800dbe1031d017b2c7;p=timeside.git ArrayDecoder: Convert array to 'float32' for compatibility with FileDecoder + add a release() method to reset iterator --- diff --git a/timeside/decoder/array.py b/timeside/decoder/array.py index 8150f24..581603a 100644 --- a/timeside/decoder/array.py +++ b/timeside/decoder/array.py @@ -65,7 +65,7 @@ class ArrayDecoder(Decoder): if samples.ndim == 1: samples = samples[:, np.newaxis] # reshape to 2D array - self.samples = samples # Create a 2 dimensions array + self.samples = samples.astype('float32') # Create a 2 dimensions array self.input_samplerate = samplerate self.input_channels = self.samples.shape[1] @@ -135,6 +135,9 @@ class ArrayDecoder(Decoder): def metadata(self): return None + @interfacedoc + def release(self): + self.frames = self.get_frames() if __name__ == "__main__": import doctest