]> git.parisson.com Git - timeside.git/commitdiff
add args and fix attributes on analyzer api tests
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 11 Oct 2013 23:04:37 +0000 (01:04 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 11 Oct 2013 23:04:37 +0000 (01:04 +0200)
tests/api/exempleCMMR_vamp.py
tests/api/exemplesCMMR.py

index 2cb8c548af930123981d47b7584d21820c9d790f..43fadc170a678703ac67bfc25bb064f844090ea2 100644 (file)
@@ -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()
index c4a2def698b6a1fbf22f37497fe37261e413761c..65130ab77676dbebc93ef5cea9ae14710588c373 100644 (file)
@@ -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']