⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module wav

Module wav 

Source
Expand description

WAV file parser (PCM only)

Parses RIFF/WAVE files and extracts PCM audio data. Supports common PCM formats (8-bit unsigned, 16-bit signed, 24-bit signed) and provides conversion utilities to normalize audio to S16Le for mixing.

§Supported Formats

  • PCM 8-bit unsigned (audio_format=1, bits_per_sample=8)
  • PCM 16-bit signed little-endian (audio_format=1, bits_per_sample=16)
  • PCM 24-bit signed little-endian (audio_format=1, bits_per_sample=24)
  • PCM 32-bit signed little-endian (audio_format=1, bits_per_sample=32)

Structs§

FmtChunk
Format chunk describing the audio data layout
WavFile
Parsed WAV file with metadata and data location
WavHeader
RIFF file header (12 bytes)

Functions§

convert_s24_to_s16
Convert signed 24-bit little-endian PCM to signed 16-bit PCM
convert_s32_to_s16
Convert signed 32-bit little-endian PCM to signed 16-bit PCM
convert_u8_to_s16
Convert unsigned 8-bit PCM to signed 16-bit PCM