6#ifndef __LIBDRAGON_AUDIO_H
7#define __LIBDRAGON_AUDIO_H
77void audio_init(
const int frequency,
int numbuffers);
205int audio_push(
const short *buffer,
int nsamples,
bool blocking);
207__attribute__((deprecated(
"use audio_write_begin or audio_push instead")))
int audio_get_buffer_length()
Get the number of stereo samples that fit into an allocated buffer.
Definition audio.c:480
void audio_set_buffer_callback(audio_fill_buffer_callback fill_buffer_callback)
Install a audio callback to fill the audio buffer when required.
Definition audio.c:263
int audio_get_frequency()
Return actual frequency of audio playback.
Definition audio.c:475
volatile int audio_can_write()
Return whether there is an empty buffer to write to.
Definition audio.c:433
short * audio_write_begin(void)
Start writing to the first free internal buffer.
Definition audio.c:372
void audio_init(const int frequency, int numbuffers)
Initialize the audio subsystem.
Definition audio.c:175
void audio_pause(bool pause)
Pause or resume audio playback.
Definition audio.c:311
void audio_write(const short *const buffer)
Write a chunk of audio data.
Definition audio.c:345
int audio_push(const short *buffer, int nsamples, bool blocking)
Push a chunk of audio data (high-level function)
Definition audio.c:445
void audio_write_end(void)
Complete writing to an internal buffer.
Definition audio.c:398
void audio_write_silence()
Write a chunk of silence.
Definition audio.c:406
void audio_close()
Close the audio subsystem.
Definition audio.c:273
void(* audio_fill_buffer_callback)(short *buffer, size_t numsamples)
Will be called periodically when more sample data is needed.
Definition audio.h:61