#[non_exhaustive]pub struct AudioConfig<T: StreamType> {Show 16 fields
pub stream: T::Config,
pub decoder_backend: DecoderBackend,
pub gapless_mode: GaplessMode,
pub preload_chunks: NonZeroUsize,
pub bus: Option<EventBus>,
pub byte_pool: Option<BytePool>,
pub cancel: Option<CancellationToken>,
pub hint: Option<String>,
pub host_sample_rate: Option<NonZeroU32>,
pub media_info: Option<MediaInfo>,
pub pcm_pool: Option<PcmPool>,
pub playback_rate: Option<Arc<AtomicF32>>,
pub worker: Option<AudioWorkerHandle>,
pub resampler_quality: ResamplerQuality,
pub effects: Vec<Box<dyn AudioEffect>>,
pub pcm_buffer_chunks: usize,
}Expand description
Configuration for audio pipeline with stream config.
Generic over StreamType to include stream-specific configuration.
Combines stream config and audio pipeline settings into a single builder.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.stream: T::ConfigStream configuration (HlsConfig, FileConfig, etc.)
decoder_backend: DecoderBackendDecoder backend selection. See DecoderBackend.
gapless_mode: GaplessModeHow leading/trailing PCM is trimmed after the decode.
preload_chunks: NonZeroUsizeNumber of chunks to buffer before signaling preload readiness.
bus: Option<EventBus>Unified event bus (optional — if not provided, one is created internally).
byte_pool: Option<BytePool>Shared byte pool for temporary buffers (probe, etc.).
cancel: Option<CancellationToken>Master cancel token for the audio pipeline.
hint: Option<String>Optional format hint (file extension like “mp3”, “wav”)
host_sample_rate: Option<NonZeroU32>Target sample rate of the audio host (for resampling).
media_info: Option<MediaInfo>Media info hint for format detection
pcm_pool: Option<PcmPool>Shared PCM pool for temporary buffers.
playback_rate: Option<Arc<AtomicF32>>Shared atomic for dynamic playback rate (1.0 = normal speed).
worker: Option<AudioWorkerHandle>Optional shared audio worker handle.
resampler_quality: ResamplerQualityResampling quality preset.
effects: Vec<Box<dyn AudioEffect>>Additional effects to append after resampler in the processing chain.
pcm_buffer_chunks: usizePCM buffer size in chunks (~100ms per chunk = 10 chunks ≈ 1s). Default: 10 on native, 32 on wasm32.
Implementations§
Source§impl<T: StreamType> AudioConfig<T>
impl<T: StreamType> AudioConfig<T>
Sourcepub fn builder() -> AudioConfigBuilder<T>
pub fn builder() -> AudioConfigBuilder<T>
Create an instance of AudioConfig using the builder syntax
Source§impl<T: StreamType> AudioConfig<T>
impl<T: StreamType> AudioConfig<T>
Sourcepub fn new(stream: T::Config) -> Self
pub fn new(stream: T::Config) -> Self
Create config with stream config and default audio settings.
Sourcepub fn for_stream(stream: T::Config) -> AudioConfigBuilder<T, SetStream>
pub fn for_stream(stream: T::Config) -> AudioConfigBuilder<T, SetStream>
Chainable counterpart to AudioConfig::new: returns a builder
with stream set so callers can attach further setters.