Skip to main content

kithara_decode/
lib.rs

1// NOTE: deny instead of forbid to allow unsafe in platform-specific FFI modules (apple, android)
2#![deny(unsafe_code)]
3
4//! # Kithara Decode
5//!
6//! Audio decoding library with pluggable backends.
7//!
8//! Provides generic decoder infrastructure supporting Symphonia (software),
9//! Apple `AudioToolbox`, and Android `MediaCodec` backends.
10//!
11//! ## Usage
12//!
13//! Use [`DecoderFactory`] for runtime codec selection:
14//! ```ignore
15//! use kithara_decode::{DecoderFactory, DecoderConfig};
16//!
17//! let decoder = DecoderFactory::create_from_media_info(source, &media_info, config)?;
18//! ```
19
20mod codec;
21mod composed;
22mod demuxer;
23mod error;
24mod factory;
25mod fmp4;
26mod gapless;
27mod mp4;
28mod pcm_time;
29#[cfg(feature = "symphonia")]
30mod symphonia;
31mod traits;
32mod types;
33
34#[cfg(any(test, feature = "mock"))]
35pub mod mock;
36
37#[cfg(all(feature = "android", target_os = "android"))]
38mod android;
39#[cfg(all(feature = "apple", any(target_os = "macos", target_os = "ios")))]
40mod apple;
41
42pub use codec::CodecPriming;
43pub use error::{DecodeError, DecodeResult, ErrorClass};
44pub use factory::{DecoderBackend, DecoderConfig, DecoderFactory};
45pub use gapless::{
46    GaplessInfo, GaplessMode, GaplessOutput, GaplessTrimmer, SilenceTrimParams, probe_mp4_gapless,
47};
48pub use pcm_time::{duration_for_frames, frames_for_duration};
49pub use traits::{
50    Decoder, DecoderChunkOutcome, DecoderInput, DecoderSeekOutcome, InputReadOutcome,
51};
52pub use types::{DecoderTrackInfo, PcmChunk, PcmMeta, PcmSpec, TrackMetadata};