The Vpr Audio Analyzer, pronounced "Vapor Audio Analyzer," is an asynchronous toolkit for working with audio files. It offers three key functions:
Extracts audio frames from an audio file and presents them as an array.
```rust let file = File::open(path).unwrap(); let reader = BufReader::new(file); let analyzer = Analyzer::new(reader);
let frames = analyzer.getaudioframes().await.unwrap(); ```
Quickly finds the duration of an audio file. If there's a XING header, it uses that for a faster calculation; otherwise, it sums up audio frame durations.
```rust let file = File::open(path).unwrap(); let reader = BufReader::new(file); let analyzer = Analyzer::new(reader);
let duration = analyzer.get_duration().await.unwrap(); ```
Creates a timestamp and byte offset index for precise navigation within an audio file, useful for accurate seeking during playback.
```rust let file = File::open(path).unwrap(); let reader = BufReader::new(file); let analyzer = Analyzer::new(reader);
let seekindex = analyzer.getseek_index().await.unwrap(); ```