struct

Tryst::SDL::AudioSpec

Inherits Struct < Value < Object

Sample format, channel count and sample rate - SDL_AudioSpec, which turns up wherever audio is described: the format a mixer produces, the format a loaded file is in, the format an AudioStream accepts.

The defaults are SDL_mixer's own working format: it mixes in float32 whatever the inputs and the device are.

Constructors

from_unsafe(spec : LibSDL::AudioSpec) : AudioSpec

@api private - the return trip, for reading a spec back out of a mixer or a stream.

Source
new(format : AudioFormat = AudioFormat::F32LE, channels : Int32 = 2, freq : Int32 = 44100)
Source

Instance methods

channels
clone
Source
copy_with(format _format = @format, channels _channels = @channels, freq _freq = @freq)
Source
format
frame_size

Bytes in one sample FRAME - one sample per channel. The unit that buffer sizes have to be a whole multiple of.

Source
freq
to_unsafe
Source