d2d.sdl2.Sound

Sound

Members

Classes

Sound
class Sound(SoundType T)

A sound is, as its name suggests, something that can be played and make a noise Sounds are templated and can either be chunks or musics A chunk sound is a short sound that is usually a sound effect or something quick; many chunks can play at once A chunk will only play once A music is something that usually plays for longer and is usually something like background music; only one sound can play at once A music will loop infinitely until destroyed This sound is a primitive port from SDL and doesn't allow for much control There is no constructor for a sound from an already existing Mix_Chunk or Mix_Music because it may have unintended behaviour

Enums

SoundType
enum SoundType

The two types of sounds there are Chunks are for sound effects and for shorter sounds Musics are for longer sounds such as background music Multiple chunks can play at once, but only one music can be playing at a time

Functions

pause
void pause()

Pauses all sounds of a type There is no implementation to pause certain sounds selectively Only the music is individually controllable For chunks, chunks are collectively paused and unpaused

resume
void resume()

Resumes all sounds of a type There is no implementation to resume certain sounds selectively Only the music is individually controllable For chunks, chunks are collectively paused and unpaused

Properties

chunkVolume
void chunkVolume [@property getter]

Sets the volume that all chunks will play at Chunks are all at the same volume; there is no implementation to control the volume of an individual chunk TODO possibly implement Mix_VolumeChunk?

chunkVolume
int chunkVolume [@property getter]

Gets the volume that all chunks will play at Chunks are all at the same volume; there is no implementation to control the volume of an individual chunk TODO possibly implement Mix_VolumeChunk?

musicVolume
void musicVolume [@property getter]

Sets the volume that the music will play at

musicVolume
int musicVolume [@property getter]

Gets the volume that the music will play at

Meta