Rubato processes audio in chunks. When constructing a resampler, you provide a chunk_size which acts as the target size for the fixed side. The other side remains variable. You can choose which side is fixed using the following modes:
- Fixed input (
FixedAsync::Input / FixedSync::Input): The input chunk size is always chunk_size. The output size varies. Use this when your audio source (e.g., hardware capture) delivers fixed-size chunks. - Fixed output (
FixedAsync::Output / FixedSync::Output): The output chunk size is always chunk_size. The input size varies. Use this when your audio destination (e.g., hardware playback) consumes fixed-size chunks. - Both input and output fixed (
FixedSync::Both): Both sides are fixed. Note: This is only available for the synchronous resampler. The chunk_size is used as a hint, and actual sizes are calculated to fit the resampling ratio exactly. This mode is more efficient as it avoids some internal buffering.
For asynchronous resamplers, you cannot fix both sides because the resampling ratio can change, requiring at least one side to be variable.
// Example of selecting a fixed side (conceptual)
// FixedAsync::Input, FixedAsync::Output, FixedSync::Input, FixedSync::Output, or FixedSync::Both