Skip to content

Commit bc1bfe0

Browse files
committed
Add test to check for equal output of simple and full API
1 parent 2d7aa2d commit bc1bfe0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/test_samplerate.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ def test_process(data, converter_type, ratio=2.0):
3232
src.process(input_data, ratio)
3333

3434

35+
def test_match(data, converter_type, ratio=2.0):
36+
num_channels, input_data = data
37+
output_simple = samplerate.resample(input_data, ratio, converter_type)
38+
resampler = samplerate.Resampler(converter_type, channels=num_channels)
39+
output_full = resampler.process(input_data, ratio, end_of_input=True)
40+
assert np.allclose(output_simple, output_full)
41+
42+
3543
def test_callback(data, converter_type, ratio=2.0):
3644
from samplerate import CallbackResampler
3745
_, input_data = data

0 commit comments

Comments
 (0)