Tryst::SDL::AudioFormat
Inherits Enum < Comparable < Value < Object
A PCM sample format - every value SDL_AudioFormat defines, so that reading a spec back out of a device or a decoder can never meet one this enum has no name for.
Both byte orders are spelled out rather than following SDL's
SDL_AUDIO_S16, which is a compile-time alias for whichever suits
the host. Pinning the byte order is what lets AudioCapture write a
WAV header without having to ask.
Constants
Unknown = 0_u32
U8 = 8_u32
S8 = 32776_u32
S16LE = 32784_u32
S16BE = 36880_u32
S32LE = 32800_u32
S32BE = 36896_u32
F32LE = 33056_u32
F32BE = 37152_u32
Instance methods
bytes_per_sample
Bytes one sample of this format occupies. SDL keeps the bit width in the low byte of the value (SDL_AUDIO_MASK_BITSIZE), which is why this is arithmetic rather than a case over nine members.