enum

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

big_endian?

SDL_AUDIO_MASK_BIG_ENDIAN.

Source
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.

Source
f32_be?

Returns true if this enum value equals F32BE

Source
f32_le?

Returns true if this enum value equals F32LE

Source
float?

SDL_AUDIO_MASK_FLOAT. True only for the F32 pair.

Source
s16_be?

Returns true if this enum value equals S16BE

Source
s16_le?

Returns true if this enum value equals S16LE

Source
s32_be?

Returns true if this enum value equals S32BE

Source
s32_le?

Returns true if this enum value equals S32LE

Source
s8?

Returns true if this enum value equals S8

Source
u8?

Returns true if this enum value equals U8

Source
unknown?

Returns true if this enum value equals Unknown

Source