Expand description
§Kithara Audio
Audio pipeline library with decoding, effects, and resampling.
§Architecture
Audio- Generic audio pipeline running in a separate threadAudioConfig- Pipeline configurationResamplerQuality- Sample rate conversion qualityAudioalso implementsrodio::Sourcedirectly (requiresrodiofeature)
§Target API
ⓘ
use kithara_audio::{Audio, AudioConfig};
use kithara_hls::{Hls, HlsConfig};
use kithara_stream::Stream;
use ringbuf::traits::Consumer;
// HLS stream with decoding
let config = AudioConfig::<Hls>::new(hls_config);
let mut audio = Audio::<Stream<Hls>>::new(config).await?;
sink.append(audio); // rodio compatible
// Or read PCM from channel directly
while let Some(chunk) = audio.pcm_rx().try_pop() {
play_audio(chunk);
}
// Events via event_bus()
let mut events = audio.event_bus().subscribe();
while let Ok(event) = events.recv().await {
println!("Audio: {:?}", event);
}Re-exports§
pub use effects::eq::EqBandConfig;pub use effects::eq::EqEffect;pub use effects::eq::FilterKind;pub use effects::eq::IsolatorEq;pub use effects::eq::generate_log_spaced_bands;
Modules§
Structs§
- Audio
- Generic audio pipeline running in a separate thread.
- Audio
Config - Configuration for audio pipeline with stream config.
- Audio
Worker Handle - Clonable handle to a shared audio worker.
- Epoch
Validator - Validator that checks epoch for seek invalidation.
- Fetch
- Fetch result from a worker source.
- Resampler
Params - Configuration parameters for the resampler effect.
- Resampler
Processor - Audio resampler that converts between source and host sample rates.
Enums§
- Chunk
Outcome - Result of
next_chunk— either a decoded chunk (with embedded spec/timing metadata), a typed non-progress signal, or natural EOF. Failures surface asErr(DecodeError). - Decode
Error - Errors that can occur during audio decoding.
- Pending
Reason - Reason a
ReadOutcome::Pending/ChunkOutcome::Pendingwas returned — i.e. why the reader did not advance this call. Each variant maps to a distinct caller action; there is no overlap and no string-matching required. - Read
Outcome - Result of a PCM read.
- Resampler
Quality - Quality preset for the audio resampler.
- Seek
Outcome - Result of a seek — either the reader landed at a known position or
the target was past the known duration. Failures surface as
Err(DecodeError). - Service
Class - Priority class for worker scheduling.
- Track
Phase Tag - Fieldless discriminant of [
TrackState] for external phase queries.
Traits§
- Audio
Effect - Audio processing effect in the chain (transforms PCM chunks).
- Audio
Worker Source - Trait for audio sources processed in a blocking worker thread.
- PcmReader
- Primary PCM interface for reading decoded audio.
Type Aliases§
- Decode
Result - Result type for decode operations.