Skip to content

Commit

Permalink
tightening trim test
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Nov 1, 2016
1 parent ec4babb commit 1acd42b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_effects.py
Expand Up @@ -146,7 +146,8 @@ def test_trim():
def __test(y, top_db, ref_power, index):

if index:
yt, idx = librosa.effects.trim(y, top_db=top_db, ref_power=ref_power,
yt, idx = librosa.effects.trim(y, top_db=top_db,
ref_power=ref_power,
index=True)

# Test for index position
Expand All @@ -164,6 +165,10 @@ def __test(y, top_db, ref_power, index):

assert np.all(logamp >= - top_db)

# Verify duration
duration = librosa.get_duration(yt)
assert np.allclose(duration, 3.0, atol=1e-1), duration

# construct 5 seconds of stereo silence
# Stick a sine wave in the middle three seconds
sr = float(22050)
Expand Down

0 comments on commit 1acd42b

Please sign in to comment.