justinsalamon / scaper

A library for soundscape synthesis and augmentation
BSD 3-Clause "New" or "Revised" License
384 stars 56 forks source link

Add tests for time stretched event duration - actual vs estimated #46

Open justinsalamon opened 5 years ago

justinsalamon commented 5 years ago

Currently when using sox for time stretching, the actual duration of the time stretched event can vary slightly from the estimated duration (estimated = duration * stretch factor). This caused a bug in post-padding, fixed by calculating post-padding based on the actual duration of the stretched event instead of the estimated duration.

Currently there are no tests to guarantee that these two values (estimated and actual duration of stretched event) are within an acceptable epsilon, so need to add tests for that.

Probably not worth implementing before migrating to pyrubberband for time stretching.