Skip to content

Commit

Permalink
Add test for test_calculate_decay_coefficient
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Sep 12, 2024
1 parent 9f6847c commit 8cd1338
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ def test_save_block_to_text_file():

@pytest.mark.skip
def test_save_block_to_wav_file():
pass
pass


def test_calculate_decay_coefficient():
decay_time = 0.5
sample_rate = 48000
decay_level = 0.001

exponent = signalflow.calculate_decay_coefficient(decay_time, sample_rate, decay_level)
rv = exponent ** (decay_time * sample_rate)
assert rv == pytest.approx(decay_level, abs=1e-6)

0 comments on commit 8cd1338

Please sign in to comment.