blob: 794b047d15c4d4e19c33b1d1b60320231cced8e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import os
import numpy as np
from nose.tools import assert_almost_equals
import simpl
import simpl.peak_detection as peak_detection
import simpl.partial_tracking as partial_tracking
import simpl.synthesis as synthesis
float_precision = 5
frame_size = 512
hop_size = 512
audio_path = os.path.join(
os.path.dirname(__file__), 'audio/flute.wav'
)
class TestSynthesis(object):
@classmethod
def setup_class(cls):
cls.audio = simpl.read_wav(audio_path)[0]
def test_synthesis(self):
pd = peak_detection.PeakDetection()
frames = pd.find_peaks(self.audio)
pt = partial_tracking.PartialTracking()
frames = pt.find_partials(frames)
s = synthesis.Synthesis()
synth_audio = s.synth(frames)
assert len(synth_audio)
|