SDLMixer

SDL_mixer library wrapper.

Constructors

this
this(SDL2 sdl2, int flags, int frequency, ushort format, int channels, int chunksize)

Loads the SDL_mixer library and opens audio.

Destructor

~this
~this()

Releases the SDL_mixer library.

Members

Functions

clearEffects
void clearEffects(int channel)

Clears all effects from the channel.

fade
void fade(int channel, Duration time)

Fades out the channel and then halts it.

getChannels
int getChannels()
getFading
Mix_Fading getFading(int channel)
getVolume
int getVolume(int channel)
halt
void halt(int channel, Duration delay)

Clears the channel and pauses it.

isPaused
bool isPaused(int channel)
isPlaying
bool isPlaying(int channel)
pause
void pause(int channel)

Pauses the channel. Passing -1 pauses all channels.

setChannels
void setChannels(int numChannels)

Sets the number of mixing channels.

setDistance
void setDistance(int channel, ubyte distance)

Sets distance from the listener on the channel, used to simulate attenuation.

setPanning
void setPanning(int channel, ubyte volumeLeft, ubyte volumeRight)

Sets stereo panning on the channel. The library must have been opened with two output channels.

setPosition
void setPosition(int channel, short angle, ubyte distance)

Set panning and distance on the channel to simulate positional audio.

setReverseStereo
void setReverseStereo(int channel, bool reverse)

Sets whether reverse stereo is enabled on the channel.

setVolume
void setVolume(int channel, int volume)

Sets the volume of the channel. Passing -1 sets volume of all channels.

unpause
void unpause(int channel)

Unpauses the channel. Passing -1 unpauses all channels.

Meta