Skip to main content

Crate kithara_audio

Crate kithara_audio 

Source
Expand description

§Kithara Audio

Audio pipeline library with decoding, effects, and resampling.

§Architecture

  • Audio - Generic audio pipeline running in a separate thread
  • AudioConfig - Pipeline configuration
  • ResamplerQuality - Sample rate conversion quality
  • Audio also implements rodio::Source directly (requires rodio feature)

§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§

effects

Structs§

Audio
Generic audio pipeline running in a separate thread.
AudioConfig
Configuration for audio pipeline with stream config.
AudioWorkerHandle
Clonable handle to a shared audio worker.
EpochValidator
Validator that checks epoch for seek invalidation.
Fetch
Fetch result from a worker source.
ResamplerParams
Configuration parameters for the resampler effect.
ResamplerProcessor
Audio resampler that converts between source and host sample rates.

Enums§

ChunkOutcome
Result of next_chunk — either a decoded chunk (with embedded spec/timing metadata), a typed non-progress signal, or natural EOF. Failures surface as Err(DecodeError).
DecodeError
Errors that can occur during audio decoding.
PendingReason
Reason a ReadOutcome::Pending / ChunkOutcome::Pending was 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.
ReadOutcome
Result of a PCM read.
ResamplerQuality
Quality preset for the audio resampler.
SeekOutcome
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).
ServiceClass
Priority class for worker scheduling.
TrackPhaseTag
Fieldless discriminant of [TrackState] for external phase queries.

Traits§

AudioEffect
Audio processing effect in the chain (transforms PCM chunks).
AudioWorkerSource
Trait for audio sources processed in a blocking worker thread.
PcmReader
Primary PCM interface for reading decoded audio.

Type Aliases§

DecodeResult
Result type for decode operations.