xaac-rs
High-level Rust bindings for AAC and xHE-AAC encoding and decoding built on top
of libxaac-sys.
This crate wraps the low-level FFI API exposed by the local libxaac-sys
crate and provides a safer, more idiomatic Rust interface for:
- AAC-LC encoding
- HE-AACv1 and HE-AACv2 encoding
- AAC-LD and AAC-ELD encoding
- USAC/xHE-AAC encoder configuration
- Decoder initialization and frame decoding
Example
Basic AAC-LC ADTS encoding:
use ;
let mut encoder = new?;
let pcm = vec!;
let packet = encoder.encode_i16_interleaved?;
assert!;
# Ok::
WAV Conversion Example
The crate includes a runnable example that converts a typical PCM WAV file to AAC ADTS:
The example:
- parses RIFF/WAVE input directly
- supports PCM WAV and
WAVE_FORMAT_EXTENSIBLE - supports 16-bit, 24-bit, and 32-bit PCM
- zero-pads the final partial frame before encoding
See examples/convert_wav_to_aac.rs.
Public API
Main exported types:
EncoderEncoderConfigProfileOutputFormatDecoderDecoderConfigDecodedFrameEncodedPacketEncodedFrameError
Validation
Verified locally with: