Skip to main content

fill_buffers_interleaved_bytes

Function fill_buffers_interleaved_bytes 

Source
pub fn fill_buffers_interleaved_bytes<T: BytesSample>(
    output_buffer: &mut [&mut [f32]],
    output_buffer_range: Range<usize>,
    start_frame_in_resource: u64,
    resource_channels: usize,
    resource_frames: usize,
    resource_data: &[u8],
) -> usize
Expand description

A helper for SampleResource::fill_buffers_f32() to fill buffers from a resource of interleaved samples stored as raw bytes.

Returns the number of frames (samples in a single channel of audio) that were successfully written to the buffer. This may be less than the requested number of frames if output_buffer_range falls outside the range of the sample resource.

ยงPanics

Panics if:

  • output_buffer_range is out-of-bounds for any channel slice in output_buffer
  • resource_samples.len() < resource_channels * resource_frames