pub struct AudioFetchParams {
pub minimum_download_size: usize,
pub minimum_throughput: usize,
pub initial_ping_time_estimate: Duration,
pub maximum_assumed_ping_time: Duration,
pub read_ahead_before_playback: Duration,
pub read_ahead_during_playback: Duration,
pub prefetch_threshold_factor: f32,
pub download_timeout: Duration,
}Fields§
§minimum_download_size: usizeThe minimum size of a block that is requested from the Spotify servers in one request.
This is the block size that is typically requested while doing a seek() on a file.
The Symphonia decoder requires this to be a power of 2 and > 32 kB.
Note: smaller requests can happen if part of the block is downloaded already.
minimum_throughput: usizeThe minimum network throughput that we expect. Together with the minimum download size, this will determine the time we will wait for a response.
initial_ping_time_estimate: DurationThe ping time that is used for calculations before a ping time was actually measured.
maximum_assumed_ping_time: DurationIf the measured ping time to the Spotify server is larger than this value, it is capped to avoid run-away block sizes and pre-fetching.
read_ahead_before_playback: DurationBefore playback starts, this many seconds of data must be present. Note: the calculations are done using the nominal bitrate of the file. The actual amount of audio data may be larger or smaller.
read_ahead_during_playback: DurationWhile playing back, this many seconds of data ahead of the current read position are requested. Note: the calculations are done using the nominal bitrate of the file. The actual amount of audio data may be larger or smaller.
prefetch_threshold_factor: f32If the amount of data that is pending (requested but not received) is less than a certain amount,
data is pre-fetched in addition to the read ahead settings above. The threshold for requesting more
data is calculated as <pending bytes> < PREFETCH_THRESHOLD_FACTOR * <ping time> * <nominal data rate>
download_timeout: DurationThe time we will wait to obtain status updates on downloading.
Implementations§
Source§impl AudioFetchParams
impl AudioFetchParams
pub fn set(params: AudioFetchParams) -> Result<(), AudioFetchParams>
pub fn get() -> &'static AudioFetchParams
Trait Implementations§
Source§impl Clone for AudioFetchParams
impl Clone for AudioFetchParams
Source§fn clone(&self) -> AudioFetchParams
fn clone(&self) -> AudioFetchParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more