-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Summary
Request to expose libsoxr's variable-rate resampling functionality through the Python API, specifically the soxr_set_io_ratio() function that allows dynamic rate changes during streaming.
Motivation
Variable-rate resampling is useful for several applications:
- Time-base correction (TBC) for video processing with wow/flutter correction
- Real-time audio processing with dynamic pitch/speed changes
- Audio synchronization where the rate needs to change during playback
- Digital signal processing applications requiring non-uniform resampling
Current Limitation
The current ResampleStream API only supports fixed-rate resampling. While libsoxr has excellent variable-rate support (see example #5), this functionality isn't exposed in the Python wrapper.
Proposed API
Add support for variable-rate resampling to ResampleStream:
# Enable variable-rate mode
rs = soxr.ResampleStream(44100, 16000, 1, variable_rate=True)
# Process chunks normally
output1 = rs.resample_chunk(chunk1)
# Change the resampling ratio dynamically
rs.set_io_ratio(48000/44100, slew_len=1024)
# Continue processing with new ratio
output2 = rs.resample_chunk(chunk2)Metadata
Metadata
Assignees
Labels
No labels