A command-line tool for viewing AAC (Advanced Audio Coding) file structures. This tool can parse and display ADTS (Audio Data Transport Stream) header information and raw data from AAC files.
- Parse and display ADTS header information
- Support viewing multiple data blocks
- Optional display of raw hexadecimal data
- Colored output for better readability
Ensure you have the Rust toolchain installed on your system, then clone this repository and build:
git clone <repository-url>
cd aac-viewer
cargo build --release
Basic usage:
./target/release/aac-viewer -f <aac-file>
Parameters:
-f, --file <FILE>
: AAC file path (required)-b, --blocks <NUMBER>
: Number of data blocks to display (default: 1, show all if 0)-x, --hex
: Display raw hexadecimal data
Examples:
# View the first data block of the file
./target/release/aac-viewer -f audio.aac
# View the first 3 data blocks
./target/release/aac-viewer -f audio.aac -b 3
# View data blocks with hexadecimal data
./target/release/aac-viewer -f audio.aac -x
The tool displays the following ADTS header information:
- Sync Word
- MPEG Version
- Layer
- Protection Bit
- Profile
- Sampling Frequency
- Channel Configuration
- Frame Length
- Buffer Fullness
- Number of Raw Data Blocks
If the -x
option is used, the raw hexadecimal data of the frame will also be displayed.