Expand description
A Rust parser for the Audio Data Transport Stream framing format often used to carry encoded AAC audio data.
AdtsHeader
is the primary type provided by this crate.
Given a buffer containing some number of ADTS frames, the first frame may be inspected by constructing a header instance with,
use adts_reader::AdtsHeader;
// let buf = ...;
match AdtsHeader::from_bytes(&buf) {
Ok(header) => println!("length (headers+payload) is {}", header.frame_length()),
Err(e) => panic!("failed to read header: {:?}", e),
}
§Unsupported
- Resynchronising
AdtsParser
after encountering bitstream error (we could search for sync-word) - Copyright identifiers (I don’t have any example bitstreams to try)
- CRC handling (probably needs to be implemented as part of AAC bitstream parsing)
Structs§
- Adts
Header - Extract information for a single ADTS frame from the start of the given byte buffer .
- Adts
Parser - Find ADTS frames within provided buffers of data, announcing audio configuration as it is discovered (normally just once at the start, but possibly changing during the stream if the stream is malformed).
- Copyright
Identification - Payload
Error - Error indicating that not enough data was provided to
AdtsHeader
to be able to extract the whole ADTS payload following the header fields.
Enums§
- Adts
Header Error - Adts
Parse Error - Audio
Object Type - Channel
Configuration - Copyright
IdErr - Copyright
Identification Start - Mpeg
Version - Originality
- Protection
Indicator - Sampling
Frequency
Traits§
- Adts
Consumer - Trait to be implemented by types that wish to consume the ADTS data produced by
AdtsParser
.