pub struct SampleCacheInfo {
pub cache_block_len: usize,
pub max_playback_speed: f64,
pub num_cache_blocks: usize,
}Expand description
Information about the caching behavior of a SampleResource.
This is only relevant for SampleResources which don’t have all of
their data loaded in memory, such as those that stream data from a disk or
over a network. SampleResources which already have all of their data
loaded in memory do not need to implement this.
This information is allowed to change (usually in response to a call
to SampleResource::notify_playhead_behavior()).
Fields§
§cache_block_len: usizeThe number of frames (samples in a single channel of audio) contained in a single cached block.
This size must be sufficient enough to where if
SampleResource::fill_buffers_f32 is called at the starting frame of
a cached block, there is ample enough time* (when playing back at the
speed reported in SampleResource::notify_playhead_behavior()) for
the stream to catch up before the cache is exhausted.
max_playback_speed: f64The maximum supported playback speed. (Where 1.0 is playing at the
sample rate of this resource, 0.5 is playing at half the sample rate
of this resource, and 2.0 is playing at twice the speed of the
sample rate of this resource).
num_cache_blocks: usizeThe number of available cache blocks.
Trait Implementations§
Source§impl Clone for SampleCacheInfo
impl Clone for SampleCacheInfo
Source§fn clone(&self) -> SampleCacheInfo
fn clone(&self) -> SampleCacheInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more