]> git.parisson.com Git - timeside.git/commitdiff
Remove AubioPitch dependency in test_decoding_stack
authorThomas Fillon <thomas@parisson.com>
Mon, 21 Apr 2014 16:06:48 +0000 (18:06 +0200)
committerThomas Fillon <thomas@parisson.com>
Mon, 21 Apr 2014 16:06:48 +0000 (18:06 +0200)
tests/test_decoding_stack.py

index cf4f89bcb49f4e53768f30c87b8e384157014ea5..020321112f8a6a227890faf9cb29cbf20a31aefd 100755 (executable)
@@ -3,7 +3,7 @@
 from __future__ import division
 
 from timeside.decoder import FileDecoder
-from timeside.analyzer import AubioPitch
+from timeside.analyzer import Level
 from timeside.core import ProcessPipe
 import numpy as np
 from unit_timeside import *
@@ -58,30 +58,30 @@ class TestDecodingFromStack(unittest.TestCase):
                               start=self.start,
                               duration=self.duration,
                               stack=True)
-        pitch_on_file = AubioPitch()
-        pipe = (decoder | pitch_on_file)
+        level_on_file = Level()
+        pipe = (decoder | level_on_file)
 
         pipe.run()
 
         self.assertIsInstance(pipe.frames_stack, list)
 
-        pitch_results_on_file = pipe.results['aubio_pitch.pitch'].data.copy()
+        results_on_file = pipe.results['level.rms'].data.copy()
 
         # If the pipe is used for a second run, the processed frames stored
         # in the stack are passed to the other processors
         # without decoding the audio source again.
         #Let's define a second analyzer equivalent to the previous one:
 
-        pitch_on_stack = AubioPitch()
-        pipe |= pitch_on_stack
+        level_on_stack = Level()
+        pipe |= level_on_stack
         pipe.run()
 
         # to assert that the frames passed to the two analyzers are the same,
         # we check that the results of these analyzers are equivalent:
-        pitch_results_on_stack = pipe.results['aubio_pitch.pitch'].data
+        results_on_stack = pipe.results['level.rms'].data
 
-        self.assertTrue(np.array_equal(pitch_results_on_stack,
-                                       pitch_results_on_file))
+        self.assertEqual(results_on_stack,
+                         results_on_file)
 
 
 if __name__ == '__main__':