Import with #import "std/audio_types".

OK :: 0
Invalid :: 2
Malformed :: 3
Unsupported :: 4
LimitExceeded :: 5
NativeFailure :: 6
AllocationFailed :: 7
IOFailure :: 8
PCM :: struct { samples: Vec(float32); rate: s32; channels: s32; }

Memory/work bounds apply before allocations. Rates are bounded to avoid

MaxBytes :: 268435456

Memory/work bounds apply before allocations. Rates are bounded to avoid enormous output for hostile headers. Whole-file APIs are intentionally bounded.

MaxFrames :: 28800000
ValidPCM :: (pcm: *PCM) -> bool
ErrorText :: (code: s32) -> string
Little :: (input: []u8, at: s64, count: s64) -> u64
PutLittle :: (output: []u8, at: s64, count: s64, value: u64)
Magic :: (input: []u8, at: s64, text: string) -> bool
Pcm16 :: (value: float64) -> s16

The PCM16 boundary for finite samples: clip overshoot to [-1, 32767/32768], scale by 32768 and truncate, as WAV output does.

SwapSamples :: (pcm: *PCM, samples: *Vec(float32))

Move ownership between caller vector and PCM without copying samples.

Source ↗ · All modules