BufferGenerator

Constructors

syz_createBufferGenerator

SYZ_CAPI syz_ErrorCode syz_createBufferGenerator(syz_Handle *out, syz_Handle context, void *config, void *userdata,
                                                 syz_UserdataFreeCallback *userdata_free_callback);

Creates a BufferGenerator. The buffer is set to NULL and the resulting generator will play silence until one is associated.

Properties

EnumTypeDefault ValueRangeDescription
SYZ_P_BUFFERObject0Any Buffer handleThe buffer to play
SYZ_P_PLAYBACK_POSITIONdouble0.0value >= 0.0The position in the buffer.
SYZ_P_LOOPINGint00 or 1Whether playback loops at the end of the buffer.

Linger behavior

Disables looping and plays until the buffer ends.

Remarks

BufferGenerators play Buffers. This is the most efficient way to play audio.

SYZ_P_PLAYBACK_POSITION is reset if SYZ_P_BUFFER is modified.

SYZ_P_PLAYBACK_POSITION can be set past the end of the buffer. If SYZ_P_LOOPING = 0, the generator will play silence. Otherwise, the position will immediately loop to the beginning.

More than one BufferGenerator can use the same underlying Buffer.

If the buffer being used by this generator is destroyed, this generator immediately begins playing silence until another buffer is associated.