From: Thomas Fillon Date: Mon, 21 Apr 2014 16:06:48 +0000 (+0200) Subject: Remove AubioPitch dependency in test_decoding_stack X-Git-Tag: 0.5.5~1^2~38^2~30 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=aac8ceec40df15d397afae93708ce1ef3e734ad1;p=timeside.git Remove AubioPitch dependency in test_decoding_stack --- diff --git a/tests/test_decoding_stack.py b/tests/test_decoding_stack.py index cf4f89b..0203211 100755 --- a/tests/test_decoding_stack.py +++ b/tests/test_decoding_stack.py @@ -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__':