RetroArch
Classes | Macros | Typedefs | Enumerations | Functions | Variables
audio_driver.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <sys/types.h>
#include <boolean.h>
#include <audio/audio_mixer.h>
#include <audio/audio_resampler.h>
#include <retro_common_api.h>
Include dependency graph for audio_driver.h:

Go to the source code of this file.

Classes

struct  audio_mixer_stream
 
struct  audio_statistics
 
struct  audio_driver
 
struct  audio_mixer_stream_params
 

Macros

#define AUDIO_CHUNK_SIZE_BLOCKING   512
 
#define AUDIO_CHUNK_SIZE_NONBLOCKING   2048
 
#define AUDIO_MAX_RATIO   16
 
#define AUDIO_MIXER_MAX_STREAMS   16
 

Typedefs

typedef struct audio_mixer_stream audio_mixer_stream_t
 
typedef struct audio_statistics audio_statistics_t
 
typedef struct audio_driver audio_driver_t
 
typedef struct audio_mixer_stream_params audio_mixer_stream_params_t
 

Enumerations

enum  audio_action {
  AUDIO_ACTION_NONE = 0, AUDIO_ACTION_RATE_CONTROL_DELTA, AUDIO_ACTION_MIXER_MUTE_ENABLE, AUDIO_ACTION_MUTE_ENABLE,
  AUDIO_ACTION_VOLUME_GAIN, AUDIO_ACTION_MIXER_VOLUME_GAIN, AUDIO_ACTION_MIXER
}
 
enum  audio_mixer_state {
  AUDIO_STREAM_STATE_NONE = 0, AUDIO_STREAM_STATE_STOPPED, AUDIO_STREAM_STATE_PLAYING, AUDIO_STREAM_STATE_PLAYING_LOOPED,
  AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL
}
 

Functions

void audio_driver_destroy_data (void)
 
void audio_driver_set_own_driver (void)
 
void audio_driver_unset_own_driver (void)
 
void audio_driver_suspend (void)
 
bool audio_driver_is_suspended (void)
 
void audio_driver_resume (void)
 
void audio_driver_set_active (void)
 
bool audio_driver_is_active (void)
 
void audio_driver_destroy (void)
 
void audio_driver_deinit_resampler (void)
 
bool audio_driver_free_devices_list (void)
 
bool audio_driver_new_devices_list (void)
 
bool audio_driver_enable_callback (void)
 
bool audio_driver_disable_callback (void)
 
const voidaudio_driver_find_handle (int index)
 
const char * audio_driver_find_ident (int index)
 
void audio_driver_set_nonblocking_state (bool enable)
 
const char * config_get_audio_driver_options (void)
 
void audio_driver_sample (int16_t left, int16_t right)
 
size_t audio_driver_sample_batch (const int16_t *data, size_t frames)
 
void audio_driver_sample_rewind (int16_t left, int16_t right)
 
size_t audio_driver_sample_batch_rewind (const int16_t *data, size_t frames)
 
bool audio_driver_mixer_extension_supported (const char *ext)
 
void audio_driver_dsp_filter_free (void)
 
void audio_driver_dsp_filter_init (const char *device)
 
void audio_driver_set_buffer_size (size_t bufsize)
 
bool audio_driver_get_devices_list (void **ptr)
 
void audio_driver_setup_rewind (void)
 
void audio_driver_monitor_adjust_system_rates (void)
 
bool audio_driver_set_callback (const void *data)
 
bool audio_driver_callback (void)
 
bool audio_driver_has_callback (void)
 
void audio_driver_monitor_set_rate (void)
 
bool audio_driver_find_driver (void)
 
bool audio_driver_toggle_mute (void)
 
bool audio_driver_start (bool is_shutdown)
 
bool audio_driver_stop (void)
 
bool audio_driver_owns_driver (void)
 
void audio_driver_unset_callback (void)
 
void audio_driver_frame_is_reverse (void)
 
void audio_set_float (enum audio_action action, float val)
 
void audio_set_bool (enum audio_action action, bool val)
 
void audio_unset_bool (enum audio_action action, bool val)
 
float * audio_get_float_ptr (enum audio_action action)
 
boolaudio_get_bool_ptr (enum audio_action action)
 
bool audio_driver_deinit (void)
 
bool audio_driver_init (void)
 
void audio_driver_menu_sample (void)
 
audio_mixer_stream_taudio_driver_mixer_get_stream (unsigned i)
 
bool audio_driver_mixer_add_stream (audio_mixer_stream_params_t *params)
 
void audio_driver_mixer_play_stream (unsigned i)
 
void audio_driver_mixer_play_stream_sequential (unsigned i)
 
void audio_driver_mixer_play_stream_looped (unsigned i)
 
void audio_driver_mixer_stop_stream (unsigned i)
 
float audio_driver_mixer_get_stream_volume (unsigned i)
 
void audio_driver_mixer_set_stream_volume (unsigned i, float vol)
 
void audio_driver_mixer_remove_stream (unsigned i)
 
enum resampler_quality audio_driver_get_resampler_quality (void)
 
enum audio_mixer_state audio_driver_mixer_get_stream_state (unsigned i)
 
const char * audio_driver_mixer_get_stream_name (unsigned i)
 
bool compute_audio_buffer_statistics (audio_statistics_t *stats)
 

Variables

audio_driver_t audio_rsound
 
audio_driver_t audio_audioio
 
audio_driver_t audio_oss
 
audio_driver_t audio_alsa
 
audio_driver_t audio_alsathread
 
audio_driver_t audio_tinyalsa
 
audio_driver_t audio_roar
 
audio_driver_t audio_openal
 
audio_driver_t audio_opensl
 
audio_driver_t audio_jack
 
audio_driver_t audio_sdl
 
audio_driver_t audio_xa
 
audio_driver_t audio_pulse
 
audio_driver_t audio_dsound
 
audio_driver_t audio_wasapi
 
audio_driver_t audio_coreaudio
 
audio_driver_t audio_xenon360
 
audio_driver_t audio_ps3
 
audio_driver_t audio_gx
 
audio_driver_t audio_ax
 
audio_driver_t audio_psp
 
audio_driver_t audio_ps2
 
audio_driver_t audio_ctr_csnd
 
audio_driver_t audio_ctr_dsp
 
audio_driver_t audio_switch
 
audio_driver_t audio_switch_thread
 
audio_driver_t audio_rwebaudio
 
audio_driver_t audio_null
 

Macro Definition Documentation

◆ AUDIO_CHUNK_SIZE_BLOCKING

#define AUDIO_CHUNK_SIZE_BLOCKING   512

◆ AUDIO_CHUNK_SIZE_NONBLOCKING

#define AUDIO_CHUNK_SIZE_NONBLOCKING   2048

◆ AUDIO_MAX_RATIO

#define AUDIO_MAX_RATIO   16

◆ AUDIO_MIXER_MAX_STREAMS

#define AUDIO_MIXER_MAX_STREAMS   16

Typedef Documentation

◆ audio_driver_t

typedef struct audio_driver audio_driver_t

◆ audio_mixer_stream_params_t

◆ audio_mixer_stream_t

◆ audio_statistics_t

Enumeration Type Documentation

◆ audio_action

Enumerator
AUDIO_ACTION_NONE 
AUDIO_ACTION_RATE_CONTROL_DELTA 
AUDIO_ACTION_MIXER_MUTE_ENABLE 
AUDIO_ACTION_MUTE_ENABLE 
AUDIO_ACTION_VOLUME_GAIN 
AUDIO_ACTION_MIXER_VOLUME_GAIN 
AUDIO_ACTION_MIXER 

◆ audio_mixer_state

Enumerator
AUDIO_STREAM_STATE_NONE 
AUDIO_STREAM_STATE_STOPPED 
AUDIO_STREAM_STATE_PLAYING 
AUDIO_STREAM_STATE_PLAYING_LOOPED 
AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL 

Function Documentation

◆ audio_driver_callback()

bool audio_driver_callback ( void  )
Here is the caller graph for this function:

◆ audio_driver_deinit()

bool audio_driver_deinit ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_deinit_resampler()

void audio_driver_deinit_resampler ( void  )
Here is the caller graph for this function:

◆ audio_driver_destroy()

void audio_driver_destroy ( void  )
Here is the caller graph for this function:

◆ audio_driver_destroy_data()

void audio_driver_destroy_data ( void  )
Here is the caller graph for this function:

◆ audio_driver_disable_callback()

bool audio_driver_disable_callback ( void  )
Here is the caller graph for this function:

◆ audio_driver_dsp_filter_free()

void audio_driver_dsp_filter_free ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_dsp_filter_init()

void audio_driver_dsp_filter_init ( const char *  device)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_enable_callback()

bool audio_driver_enable_callback ( void  )
Here is the caller graph for this function:

◆ audio_driver_find_driver()

bool audio_driver_find_driver ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_find_handle()

const void* audio_driver_find_handle ( int  idx)

audio_driver_find_handle: : index of driver to get handle to.

Returns: handle to audio driver at index. Can be NULL if nothing found.

audio_driver_find_handle: : index of driver to get handle to.

Returns: handle to audio driver at index. Can be NULL if nothing found.

Here is the caller graph for this function:

◆ audio_driver_find_ident()

const char* audio_driver_find_ident ( int  idx)

audio_driver_find_ident: : index of driver to get handle to.

Returns: Human-readable identifier of audio driver at index. Can be NULL if nothing found.

audio_driver_find_ident: : index of driver to get handle to.

Returns: Human-readable identifier of audio driver at index. Can be NULL if nothing found.

Here is the caller graph for this function:

◆ audio_driver_frame_is_reverse()

void audio_driver_frame_is_reverse ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_free_devices_list()

bool audio_driver_free_devices_list ( void  )
Here is the caller graph for this function:

◆ audio_driver_get_devices_list()

bool audio_driver_get_devices_list ( void **  ptr)
Here is the caller graph for this function:

◆ audio_driver_get_resampler_quality()

enum resampler_quality audio_driver_get_resampler_quality ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_has_callback()

bool audio_driver_has_callback ( void  )
Here is the caller graph for this function:

◆ audio_driver_init()

bool audio_driver_init ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_is_active()

bool audio_driver_is_active ( void  )
Here is the caller graph for this function:

◆ audio_driver_is_suspended()

bool audio_driver_is_suspended ( void  )
Here is the caller graph for this function:

◆ audio_driver_menu_sample()

void audio_driver_menu_sample ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_add_stream()

bool audio_driver_mixer_add_stream ( audio_mixer_stream_params_t params)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_extension_supported()

bool audio_driver_mixer_extension_supported ( const char *  ext)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_get_stream()

audio_mixer_stream_t* audio_driver_mixer_get_stream ( unsigned  i)
Here is the caller graph for this function:

◆ audio_driver_mixer_get_stream_name()

const char* audio_driver_mixer_get_stream_name ( unsigned  i)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_get_stream_state()

enum audio_mixer_state audio_driver_mixer_get_stream_state ( unsigned  i)
Here is the caller graph for this function:

◆ audio_driver_mixer_get_stream_volume()

float audio_driver_mixer_get_stream_volume ( unsigned  i)
Here is the caller graph for this function:

◆ audio_driver_mixer_play_stream()

void audio_driver_mixer_play_stream ( unsigned  i)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_play_stream_looped()

void audio_driver_mixer_play_stream_looped ( unsigned  i)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_play_stream_sequential()

void audio_driver_mixer_play_stream_sequential ( unsigned  i)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_remove_stream()

void audio_driver_mixer_remove_stream ( unsigned  i)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_set_stream_volume()

void audio_driver_mixer_set_stream_volume ( unsigned  i,
float  vol 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_mixer_stop_stream()

void audio_driver_mixer_stop_stream ( unsigned  i)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_monitor_adjust_system_rates()

void audio_driver_monitor_adjust_system_rates ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_monitor_set_rate()

void audio_driver_monitor_set_rate ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_new_devices_list()

bool audio_driver_new_devices_list ( void  )
Here is the caller graph for this function:

◆ audio_driver_owns_driver()

bool audio_driver_owns_driver ( void  )
Here is the caller graph for this function:

◆ audio_driver_resume()

void audio_driver_resume ( void  )
Here is the caller graph for this function:

◆ audio_driver_sample()

void audio_driver_sample ( int16_t  left,
int16_t  right 
)

audio_driver_sample: : value of the left audio channel. : value of the right audio channel.

Audio sample render callback function.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_sample_batch()

size_t audio_driver_sample_batch ( const int16_t data,
size_t  frames 
)

audio_driver_sample_batch: : pointer to audio buffer. : amount of audio frames to push.

Batched audio sample render callback function.

Returns: amount of frames sampled. Will be equal to unless exceeds (AUDIO_CHUNK_SIZE_NONBLOCKING / 2).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_sample_batch_rewind()

size_t audio_driver_sample_batch_rewind ( const int16_t data,
size_t  frames 
)

audio_driver_sample_batch_rewind: : pointer to audio buffer. : amount of audio frames to push.

Batched audio sample render callback function (rewind version).

This callback function will be used instead of audio_driver_sample_batch when rewinding is activated.

Returns: amount of frames sampled. Will be equal to unless exceeds (AUDIO_CHUNK_SIZE_NONBLOCKING / 2).

Here is the caller graph for this function:

◆ audio_driver_sample_rewind()

void audio_driver_sample_rewind ( int16_t  left,
int16_t  right 
)

audio_driver_sample_rewind: : value of the left audio channel. : value of the right audio channel.

Audio sample render callback function (rewind version). This callback function will be used instead of audio_driver_sample when rewinding is activated.

Here is the caller graph for this function:

◆ audio_driver_set_active()

void audio_driver_set_active ( void  )
Here is the caller graph for this function:

◆ audio_driver_set_buffer_size()

void audio_driver_set_buffer_size ( size_t  bufsize)
Here is the caller graph for this function:

◆ audio_driver_set_callback()

bool audio_driver_set_callback ( const void data)
Here is the caller graph for this function:

◆ audio_driver_set_nonblocking_state()

void audio_driver_set_nonblocking_state ( bool  enable)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_set_own_driver()

void audio_driver_set_own_driver ( void  )

◆ audio_driver_setup_rewind()

void audio_driver_setup_rewind ( void  )
Here is the caller graph for this function:

◆ audio_driver_start()

bool audio_driver_start ( bool  is_shutdown)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_stop()

bool audio_driver_stop ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_driver_suspend()

void audio_driver_suspend ( void  )
Here is the caller graph for this function:

◆ audio_driver_toggle_mute()

bool audio_driver_toggle_mute ( void  )
Here is the caller graph for this function:

◆ audio_driver_unset_callback()

void audio_driver_unset_callback ( void  )
Here is the caller graph for this function:

◆ audio_driver_unset_own_driver()

void audio_driver_unset_own_driver ( void  )
Here is the caller graph for this function:

◆ audio_get_bool_ptr()

bool* audio_get_bool_ptr ( enum audio_action  action)
Here is the caller graph for this function:

◆ audio_get_float_ptr()

float* audio_get_float_ptr ( enum audio_action  action)
Here is the caller graph for this function:

◆ audio_set_bool()

void audio_set_bool ( enum audio_action  action,
bool  val 
)

◆ audio_set_float()

void audio_set_float ( enum audio_action  action,
float  val 
)
Here is the caller graph for this function:

◆ audio_unset_bool()

void audio_unset_bool ( enum audio_action  action,
bool  val 
)

◆ compute_audio_buffer_statistics()

bool compute_audio_buffer_statistics ( audio_statistics_t stats)

compute_audio_buffer_statistics:

Computes audio buffer statistics.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_audio_driver_options()

const char* config_get_audio_driver_options ( void  )

config_get_audio_driver_options:

Get an enumerated list of all audio driver names, separated by '|'.

Returns: string listing of all audio driver names, separated by '|'.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ audio_alsa

audio_driver_t audio_alsa

◆ audio_alsathread

audio_driver_t audio_alsathread

◆ audio_audioio

audio_driver_t audio_audioio

◆ audio_ax

audio_driver_t audio_ax

◆ audio_coreaudio

audio_driver_t audio_coreaudio

◆ audio_ctr_csnd

audio_driver_t audio_ctr_csnd

◆ audio_ctr_dsp

audio_driver_t audio_ctr_dsp

◆ audio_dsound

audio_driver_t audio_dsound

◆ audio_gx

audio_driver_t audio_gx

◆ audio_jack

audio_driver_t audio_jack

◆ audio_null

audio_driver_t audio_null

◆ audio_openal

audio_driver_t audio_openal

◆ audio_opensl

audio_driver_t audio_opensl

◆ audio_oss

audio_driver_t audio_oss

◆ audio_ps2

audio_driver_t audio_ps2

◆ audio_ps3

audio_driver_t audio_ps3

◆ audio_psp

audio_driver_t audio_psp

◆ audio_pulse

audio_driver_t audio_pulse

◆ audio_roar

audio_driver_t audio_roar

◆ audio_rsound

audio_driver_t audio_rsound

◆ audio_rwebaudio

audio_driver_t audio_rwebaudio

◆ audio_sdl

audio_driver_t audio_sdl

◆ audio_switch

audio_driver_t audio_switch

◆ audio_switch_thread

audio_driver_t audio_switch_thread

◆ audio_tinyalsa

audio_driver_t audio_tinyalsa

◆ audio_wasapi

audio_driver_t audio_wasapi

◆ audio_xa

audio_driver_t audio_xa

◆ audio_xenon360

audio_driver_t audio_xenon360