-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resampling #9
Comments
Implementing this could lay the groundwork for realtime timestreching which also requires changing the rate at which data is read from the filesystem. Unfortunately there are not any Rust libraries for timestretching (yet). |
I was under the mistaken impression that variable speed playback required reading data from files at different speeds. I took a closer look at how it works in Mixxx and the code that reads audio from files only uses the playback rate to determine the direction. Mixxx uses a fixed block size which is assumed to be good enough for any settings of playback sample rate, audio file sample rate, and buffer size that a user may want. In practice this works. I cannot recall any bugs reported for Mixxx that were are result of that block size being too small. creek's default block size is already twice Mixxx's block size. If an application developer finds that is insufficient, they can already adjust the block size when initializing the ReadDiskStream. So I don't think resampling should be within creek's scope. It is up to the code using creek to resample the audio from the file. For variable speed playback, the application can already request to read however many frames it needs from creek then resample those to the output buffer length. |
It would be really convenient if creek could do automatic resampling to a specified sample rate. When JACK is running at 44100 Hz, I want to be able to play 48000 kHz files at the correct pitch. This could already be done by the user after getting audio data from creek. However, that is not trivial because resampling changes the rate at which creek needs to read from the file to get the desired number of frames at the desired sample rate. This could be done with rubato.
The text was updated successfully, but these errors were encountered: