Expand description
§Usage
Create a Parser with Parser::default.
Call Parser::read_instruction to get where in the file you need to read.
Read the file.
Call Parser::process_data with the data you read.
In the end you will get meta data about the format of the samples and the location of teh
samples themselves.
§Handling untrusted data
This library may ask you to read data outside of the range of the file / whatever is storing the WAVE. The meta data might point to a range outside of the file. It’s your responsibility to validate those ranges if you want to.
§The WAVE format
See
- https://en.wikipedia.org/wiki/WAV#File_specifications
- https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html
Basically, a WAVE file is formatted with RIFF. There is a fmt chunk that contains
information such as the number of channels and bits per sample. There is a data chunk
that contains the actual audio samples. There can also be other chunks to describe things like
the artist and title of the song, but they are not needed for simply playing audio.