AtlatestRepositorysigil-audio
sigil-audio / tree / src / caudio-stream.h
1
/*2
* audio-stream.h - Streaming audio sink for sigil-audio3
*4
* SPSC lockless ring buffer from any Sigil thread (producer) to5
* sokol_audio's stream callback thread (consumer). See6
* folio topics/sigil-audio-streaming-sink-architecture.7
*/9
#ifndef SIGIL_AUDIO_STREAM_H10
#define SIGIL_AUDIO_STREAM_H12
#include "sigil/sigil.h"14
/* Called from the audio callback (audio.c) after play-sound / play-music15
* mixing. Drains each registered stream into the output buffer, padding16
* with silence on under-run. Stream mix is additive. */17
void 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. */20
void sigil__register_audio_stream(SigilVM *vm);22
/* Called from audio-shutdown to stop and detach all streams. Frees no23
* memory — stream handles stay alive via GC, but are marked closed. */24
void sigil_audio_stream_shutdown_all(void);26
#endif