AtlatestRepositorysigil-audio
sigil-audio / tree / src / caudio-device.h
1
/*2
* audio-device.h - the playback device (miniaudio-impl.c) as audio.c sees it3
*/5
#ifndef SIGIL_AUDIO_DEVICE_H6
#define SIGIL_AUDIO_DEVICE_H8
/* Fill `frames` frames of interleaved f32 samples for `channels` channels;9
* runs on the device's own thread. */10
typedef void (*sigil_audio_stream_cb)(float *buffer, int frames, int channels);12
/* Open and start the playback device: 0 on success, -1 when no backend13
* could be initialised or no device opened (already reported on stderr). */14
int sigil_audio_device_open(int sample_rate, int channels, int buffer_frames,15
sigil_audio_stream_cb stream_cb);16
void sigil_audio_device_close(void);18
/* miniaudio's name for the backend in use ("PulseAudio", "ALSA", "JACK",19
* "WASAPI", "Core Audio", ...), or NULL when no device is open. */20
const char *sigil_audio_device_backend(void);22
/* The backend as a lowercase symbol name for Scheme ("pulseaudio", "alsa",23
* "jack", "wasapi", "dsound", "winmm", "coreaudio", "null", "other"), or24
* NULL when no device is open. PipeWire desktops answer "pulseaudio"25
* (pipewire-pulse): miniaudio has no PipeWire backend of its own. */26
const char *sigil_audio_device_backend_symbol(void);28
/* 1 when a device is open on a real backend, 0 on the Null backend (frames29
* are consumed in silence) or with no device. */30
int sigil_audio_device_real(void);32
#endif /* SIGIL_AUDIO_DEVICE_H */