rodio icon indicating copy to clipboard operation
rodio copied to clipboard

Configurable buffer size

Open PetrGlad opened this issue 1 year ago • 31 comments

I needed to configure smaller buffer size to reduce playback delays (for a MIDI/VST application), and could not find a better way than to patch rodio. Notes:

  • This is a breaking change, I needed to pass the buffer size to new_output_stream_with_format, it is likely possible to rewrite this, keeping that function intact if necessary.
  • Using references to pass parameters is not strictly required, but the stream constructor does not need to own them, and it made it a bit easier to required some parameters after calling
  • SampleFormat probably should be a part of StreamConfig. This will streamline the construction parameters. It is not clear to me what this affects, though.

The version from this patch works for me. I am willing to rework the request if there is a better idea how to do this.

PetrGlad avatar Oct 01 '23 21:10 PetrGlad