AtlatestRepositorysigil-audio

sigil-audio / tree / src / caudio-stream.h

1/*
2 * audio-stream.h - Streaming audio sink for sigil-audio
3 *
4 * SPSC lockless ring buffer from any Sigil thread (producer) to
5 * sokol_audio's stream callback thread (consumer). See
6 * folio topics/sigil-audio-streaming-sink-architecture.
7 */
8
9#ifndef SIGIL_AUDIO_STREAM_H
10#define SIGIL_AUDIO_STREAM_H
12#include "sigil/sigil.h"
14/* Called from the audio callback (audio.c) after play-sound / play-music
15 * mixing. Drains each registered stream into the output buffer, padding
16 * with silence on under-run. Stream mix is additive. */
17void sigil_audio_stream_mix_all(float *out, int num_frames, int out_channels);
19/* Register natives into the current module; called from audio.c init. */
20void sigil__register_audio_stream(SigilVM *vm);
22/* Called from audio-shutdown to stop and detach all streams. Frees no
23 * memory — stream handles stay alive via GC, but are marked closed. */
24void sigil_audio_stream_shutdown_all(void);
26#endif