parse

Function parse 

Source
pub fn parse(data: &[u8]) -> Result<AudioRecording, SdCardError>
Expand description

Parse a WAV audio recording file from raw bytes.

Validates the RIFF/WAV header structure and verifies the audio format matches the TH-D75 specification (16 kHz, 16-bit, mono PCM).

ยงErrors

Returns SdCardError::FileTooSmall if the data is shorter than the minimum WAV header size (44 bytes).

Returns SdCardError::InvalidWavHeader if the RIFF magic, WAVE format tag, fmt chunk ID, or audio format code is invalid.

Returns SdCardError::UnexpectedAudioFormat if the sample rate, bit depth, or channel count does not match the expected TH-D75 format.