From 37e99837fe8d762c7d69cc800dbe1031d017b2c7 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Tue, 11 Mar 2014 17:43:06 +0100 Subject: [PATCH] ArrayDecoder: Convert array to 'float32' for compatibility with FileDecoder + add a release() method to reset iterator --- timeside/decoder/array.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.5