Module slice

Source
Expand description

This module provides various helper functions for performing operations on slices of frames.

Functions§

add_in_place
Adds every sample in slice b to every sample in slice a respectively.
add_in_place_with_amp_per_channel
Scale the amplitude of each frame in b by amp_per_channel before summing it onto a.
equilibrium
Sets the slice of frames at the associated Sample’s equilibrium value.
from_boxed_frame_slice
Converts the given boxed slice of Frames into some slice T.
from_boxed_sample_slice
Converts the given boxed slice of Samples into some slice T.
from_frame_slice
Converts the given slice of Frames into some slice T.
from_frame_slice_mut
Converts the given slice of mutable Frames into some mutable slice T.
from_sample_slice
Converts the given slice of Samples into some slice T.
from_sample_slice_mut
Converts the given mutable slice of Samples into some mutable slice T.
map_in_place
Mutate every element in the slice with the given function.
to_boxed_frame_slice
Converts the given boxed slice into a boxed slice of Frames.
to_boxed_sample_slice
Converts the given boxed slice into a boxed slice of Samples.
to_frame_slice
Converts the given slice into a slice of Frames.
to_frame_slice_mut
Converts the given mutable slice into a mutable slice of Frames.
to_sample_slice
Converts the given slice into a slice of Samples.
to_sample_slice_mut
Converts the given mutable slice of Frames into a mutable slice of Samples.
write
Writes every sample in slice b to slice a.
zip_map_in_place
Mutate every frame in slice a while reading from each frame in slice b in lock-step using the given function.