From 637231e4f3e57d0d10d4dc1b7aafa4737f8ef8e2 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Sat, 12 Oct 2013 01:04:37 +0200 Subject: [PATCH] add args and fix attributes on analyzer api tests --- tests/api/exempleCMMR_vamp.py | 12 +++++------- tests/api/exemplesCMMR.py | 10 +++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/tests/api/exempleCMMR_vamp.py b/tests/api/exempleCMMR_vamp.py index 2cb8c54..43fadc1 100644 --- a/tests/api/exempleCMMR_vamp.py +++ b/tests/api/exempleCMMR_vamp.py @@ -6,17 +6,15 @@ Created on Fri Oct 11 13:22:37 2013 """ from __future__ import division -import timeside.decoder -import timeside.encoder -import timeside.grapher -import timeside.analyzer +import timeside import matplotlib.pyplot as plt import numpy as np +import sys + +wav_file = sys.argv[-1] -wavFile = 'TimeSide/tests/samples/sweep.mp3' -wavFile = '/home/thomas/data/CNRSMH_E_1985_001_001_001_04.wav' # normal -d = timeside.decoder.FileDecoder(wavFile, start=10, duration=15) +d = timeside.decoder.FileDecoder(wav_file, start=10, duration=15) specgram = timeside.analyzer.Spectrogram() waveform = timeside.analyzer.Waveform() diff --git a/tests/api/exemplesCMMR.py b/tests/api/exemplesCMMR.py index c4a2def..65130ab 100644 --- a/tests/api/exemplesCMMR.py +++ b/tests/api/exemplesCMMR.py @@ -5,10 +5,7 @@ Created on Tue Jul 16 13:04:49 2013 @author: thomas """ from __future__ import division -import timeside.decoder -import timeside.encoder -import timeside.grapher -import timeside.analyzer +import timeside import matplotlib.pyplot as plt import numpy as np import sys @@ -23,8 +20,7 @@ aubio_temporal = timeside.analyzer.AubioTemporal() specgram = timeside.analyzer.Spectrogram() waveform = timeside.analyzer.Waveform() #g = timeside.grapher.Spectrogram() -# -# + pipe = (decoder | aubio_pitch | aubio_temporal | specgram | waveform).run() pipe.results.keys() @@ -37,7 +33,7 @@ N = spec_res.parameters['FFT_SIZE'] plt.imshow(20 * np.log10(spec_res.data.T), origin='lower', extent=[spec_res.time[0], spec_res.time[-1], 0, - (N // 2 + 1) / N * spec_res.frameMetadata.samplerate], + (N // 2 + 1) / N * spec_res.frame_metadata.samplerate], aspect='auto') res_pitch = aubio_pitch.results['aubio_pitch'] -- 2.39.5