RetroArch
Classes | Macros | Functions | Variables
audio_mixer.c File Reference
#include <audio/audio_mixer.h>
#include <audio/audio_resampler.h>
#include <formats/rwav.h>
#include <memalign.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
Include dependency graph for audio_mixer.c:

Classes

struct  audio_mixer_sound
 
struct  audio_mixer_voice
 

Macros

#define AUDIO_MIXER_MAX_VOICES   8
 
#define AUDIO_MIXER_TEMP_BUFFER   8192
 

Functions

static bool wav2float (const rwav_t *wav, float **pcm, size_t samples_out)
 
static bool one_shot_resample (const float *in, size_t samples_in, unsigned rate, float **out, size_t *samples_out)
 
void audio_mixer_init (unsigned rate)
 
void audio_mixer_done (void)
 
audio_mixer_sound_taudio_mixer_load_wav (void *buffer, int32_t size)
 
audio_mixer_sound_taudio_mixer_load_ogg (void *buffer, int32_t size)
 
audio_mixer_sound_taudio_mixer_load_flac (void *buffer, int32_t size)
 
audio_mixer_sound_taudio_mixer_load_mp3 (void *buffer, int32_t size)
 
audio_mixer_sound_taudio_mixer_load_mod (void *buffer, int32_t size)
 
void audio_mixer_destroy (audio_mixer_sound_t *sound)
 
static bool audio_mixer_play_wav (audio_mixer_sound_t *sound, audio_mixer_voice_t *voice, bool repeat, float volume, audio_mixer_stop_cb_t stop_cb)
 
audio_mixer_voice_taudio_mixer_play (audio_mixer_sound_t *sound, bool repeat, float volume, audio_mixer_stop_cb_t stop_cb)
 
void audio_mixer_stop (audio_mixer_voice_t *voice)
 
static void audio_mixer_mix_wav (float *buffer, size_t num_frames, audio_mixer_voice_t *voice, float volume)
 
void audio_mixer_mix (float *buffer, size_t num_frames, float volume_override, bool override)
 
float audio_mixer_voice_get_volume (audio_mixer_voice_t *voice)
 
void audio_mixer_voice_set_volume (audio_mixer_voice_t *voice, float val)
 

Variables

static struct audio_mixer_voice s_voices [AUDIO_MIXER_MAX_VOICES]
 
static unsigned s_rate = 0
 

Macro Definition Documentation

◆ AUDIO_MIXER_MAX_VOICES

#define AUDIO_MIXER_MAX_VOICES   8

◆ AUDIO_MIXER_TEMP_BUFFER

#define AUDIO_MIXER_TEMP_BUFFER   8192

Function Documentation

◆ audio_mixer_destroy()

void audio_mixer_destroy ( audio_mixer_sound_t sound)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_mixer_done()

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

◆ audio_mixer_init()

void audio_mixer_init ( unsigned  rate)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_mixer_load_flac()

audio_mixer_sound_t* audio_mixer_load_flac ( void buffer,
int32_t  size 
)
Here is the caller graph for this function:

◆ audio_mixer_load_mod()

audio_mixer_sound_t* audio_mixer_load_mod ( void buffer,
int32_t  size 
)
Here is the caller graph for this function:

◆ audio_mixer_load_mp3()

audio_mixer_sound_t* audio_mixer_load_mp3 ( void buffer,
int32_t  size 
)
Here is the caller graph for this function:

◆ audio_mixer_load_ogg()

audio_mixer_sound_t* audio_mixer_load_ogg ( void buffer,
int32_t  size 
)
Here is the caller graph for this function:

◆ audio_mixer_load_wav()

audio_mixer_sound_t* audio_mixer_load_wav ( void buffer,
int32_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_mixer_mix()

void audio_mixer_mix ( float *  buffer,
size_t  num_frames,
float  volume_override,
bool  override 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_mixer_mix_wav()

static void audio_mixer_mix_wav ( float *  buffer,
size_t  num_frames,
audio_mixer_voice_t voice,
float  volume 
)
static
Here is the caller graph for this function:

◆ audio_mixer_play()

audio_mixer_voice_t* audio_mixer_play ( audio_mixer_sound_t sound,
bool  repeat,
float  volume,
audio_mixer_stop_cb_t  stop_cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_mixer_play_wav()

static bool audio_mixer_play_wav ( audio_mixer_sound_t sound,
audio_mixer_voice_t voice,
bool  repeat,
float  volume,
audio_mixer_stop_cb_t  stop_cb 
)
static
Here is the caller graph for this function:

◆ audio_mixer_stop()

void audio_mixer_stop ( audio_mixer_voice_t voice)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_mixer_voice_get_volume()

float audio_mixer_voice_get_volume ( audio_mixer_voice_t voice)

◆ audio_mixer_voice_set_volume()

void audio_mixer_voice_set_volume ( audio_mixer_voice_t voice,
float  val 
)
Here is the caller graph for this function:

◆ one_shot_resample()

static bool one_shot_resample ( const float *  in,
size_t  samples_in,
unsigned  rate,
float **  out,
size_t *  samples_out 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wav2float()

static bool wav2float ( const rwav_t wav,
float **  pcm,
size_t  samples_out 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_rate

unsigned s_rate = 0
static

◆ s_voices

struct audio_mixer_voice s_voices[AUDIO_MIXER_MAX_VOICES]
static