AudioCore is a high-performance Rust library for audio decoding and media container parsing. Supports FLAC, MP3, OGG, WAV, AAC, Opus, and WebM formats with zero-copy operations.
- Multi-format audio decoding with seamless playback
- Media container demuxing and stream extraction
- Comprehensive metadata and tag reading
- Automatic format detection and codec selection
- Memory-safe audio buffer manipulation
- Minimal runtime dependencies
- Optimized for embedded and server environments
Future development targets:
- WebAssembly compilation for browser applications
- C-compatible FFI bindings for language interoperability
Enable specific codecs and containers via feature flags. Default configuration includes royalty-free formats only.
| Format | Status | Gapless | Feature | Default | Crate |
|---|---|---|---|---|---|
| MP4 | Stable | No | mp4 |
No | audiocore-format-mp4 |
| WebM | Beta | No | webm |
Yes | audiocore-format-webm |
| OGG | Stable | Yes | ogg |
Yes | audiocore-format-ogg |
| WAV | Production | Yes | wav |
Yes | audiocore-format-wav |
| Codec | Status | Gapless | Feature | Default | Crate |
|---|---|---|---|---|---|
| AAC | Stable | No | aac |
No | audiocore-codec-aac |
| FLAC | Production | Yes | flac |
Yes | audiocore-codec-flac |
| MP3 | Production | Yes | mp3 |
No | audiocore-codec-mp3 |
| Opus | Stable | Yes | opus |
Yes | audiocore-codec-opus |
| Vorbis | Production | Yes | vorbis |
Yes | audiocore-codec-vorbis |
AudioCore prioritizes:
- Bit-perfect decoding accuracy matching reference implementations
- Robust error handling and input validation
- Comprehensive fuzz testing coverage
- Consistent, well-documented APIs
Performance benchmarks show AudioCore operates within ±10% of optimized C implementations across common codecs and CPU architectures.
use audiocore::{FormatReader, Decoder};
use std::fs::File;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open audio file
let mut file = File::open("audio.mp3")?;
// Detect format and create reader
let mut reader = FormatReader::detect(&mut file)?;
// Get default audio track
let track = reader.default_track().unwrap();
// Create decoder for the track
let mut decoder = Decoder::new(track.codec_params())?;
// Decode packets
while let Some(packet) = reader.next_packet()? {
let decoded = decoder.decode(&packet)?;
// Process audio samples...
}
Ok(())
}audiocore-play- Command-line audio player with format probingaudiocore-check- Validation tool for decoder output verificationaudiocore-bench- Performance benchmarking suite
MPL-2.0 - See LICENSE file for complete terms.
Contributions welcome! Please review contribution guidelines and ensure all code matches project coding standards. All submissions must be compatible with MPL-2.0 licensing.