coastline 0.0.4
Loading...
Searching...
No Matches
sdlmixer.h File Reference
#include <cstdint>
#include "ear/wavechunks.h"
Include dependency graph for sdlmixer.h:

Go to the source code of this file.

Classes

class  EarSdlVoice
 A buffer of samples the mixer plays, as a secondary buffer of DirectSound plays in the original. More...

Functions

void EarSetSdlMixerOffline (bool offline)
 Select whether the mixer renders on request, through EarRenderSdlMixer(), rather than to the default playback device.
bool EarOpenSdlMixer ()
 Open the mixer, and the default playback device unless it renders on request.
void EarCloseSdlMixer ()
 Close the mixer and its device, and delete every buffer.
void EarSetSdlMixerEnabled (bool enabled)
 Enable or suspend sound-effect mixing and playback updates without discarding voices.
bool EarSdlMixerEnabled ()
void EarRenderSdlMixer (std::int16_t *samples, int frames)
 Mix frames of a mixer that renders on request, and advance its clock by their time.

Variables

constexpr int EAR_MIX_RATE = 22050
 The frames a second EAR mixes at, the format it gives the primary buffer of DirectSound.
constexpr int EAR_MIX_CHANNELS = 2
 The channels EAR mixes, the format it gives the primary buffer of DirectSound.

Function Documentation

◆ EarSetSdlMixerOffline()

void EarSetSdlMixerOffline ( bool offline)

Select whether the mixer renders on request, through EarRenderSdlMixer(), rather than to the default playback device.

The choice applies when the mixer opens.

Parameters
offlineWhether to render on request.

◆ EarOpenSdlMixer()

bool EarOpenSdlMixer ( )

Open the mixer, and the default playback device unless it renders on request.

Returns
Whether the mixer opened.

◆ EarCloseSdlMixer()

void EarCloseSdlMixer ( )

Close the mixer and its device, and delete every buffer.

◆ EarSetSdlMixerEnabled()

void EarSetSdlMixerEnabled ( bool enabled)

Enable or suspend sound-effect mixing and playback updates without discarding voices.

Parameters
enabledWhether mixing should advance; a live output stream is resumed or paused too.

◆ EarSdlMixerEnabled()

bool EarSdlMixerEnabled ( )
Returns
Whether sound-effect mixing and playback updates are enabled.

◆ EarRenderSdlMixer()

void EarRenderSdlMixer ( std::int16_t * samples,
int frames )

Mix frames of a mixer that renders on request, and advance its clock by their time.

Parameters
samplesThe interleaved stereo 16-bit samples, two for each frame.
framesThe frames to mix.

Variable Documentation

◆ EAR_MIX_RATE

int EAR_MIX_RATE = 22050
inlineconstexpr

The frames a second EAR mixes at, the format it gives the primary buffer of DirectSound.

◆ EAR_MIX_CHANNELS

int EAR_MIX_CHANNELS = 2
inlineconstexpr

The channels EAR mixes, the format it gives the primary buffer of DirectSound.