Skip to main content

Module buffer

Module buffer 

Source
Expand description

Provides utilities for converting between planar and interleaved audio buffers, SIMD-accelerated buffer operations, and safe abstractions for working with interleaved audio data.

Structs§

TempBuffer
A preallocated buffer slice with persistent start/end positions and helper functions.

Traits§

InterleavedBuffer
Provides safe and efficient methods to access interleaved audio data, such as iterating over frames or individual channels, without needing to perform manual index calculations. It is implemented for common buffer types like &[f32] and Vec<f32>.
InterleavedBufferMut
Extends InterleavedBuffer with methods for modifying the buffer’s contents. It provides safe and efficient ways to get mutable access to frames or individual channels.

Functions§

add_buffers
Dest += Source
add_buffers_with_simd
Dest += Source
clear_buffer
Dest = 0.0
clear_buffer_with_simd
Dest = 0.0
copy_buffers
Dest = Source
copy_buffers_with_simd
Dest = Source
interleaved_to_planar
Copy the given interleaved buffer into a planar one. The planar buffer’s layout defines layout of the interleaved buffer (channel and frame count). The interleaved buffer must be large enough to fill the planar buffer.
max_abs_sample
Find the maximum absolute value in a buffer using SIMD
max_abs_sample_with_simd
Find the maximum absolute value in a buffer using SIMD
planar_to_interleaved
Copy the given planar buffer into an interleaved one. The planar buffer’s layout defines layout of the interleaved buffer (channel and frame count). The interleaved buffer must be large enough to fit the planar buffer.
remap_buffer_channels
Remaps interleaved audio between channel layouts.
scale_buffer
Dest *= Value
scale_buffer_with_simd
Dest *= Value