Music

Streamed music played from an audio file.

Constructors

this
this()

Default constructor.

Destructor

~this
~this()

Destructor

Members

Functions

getDuration
Duration getDuration()

Get the total duration of the music.

onGetData
bool onGetData(ref const(short)[] samples)

Request a new chunk of audio samples from the stream source.

onSeek
void onSeek(Duration timeOffset)

Change the current playing position in the stream source.

openFromFile
bool openFromFile(string filename)

Open a music from an audio file.

openFromMemory
bool openFromMemory(const(void)[] data)

Open a music from an audio file in memory.

openFromStream
bool openFromStream(InputStream stream)

Open a music from an audio file in memory.

Inherited Members

From SoundStream

~this
~this()

Destructor.

initialize
void initialize(uint channelCount, uint sampleRate)

Define the audio stream parameters.

pitch
float pitch [@property setter]
float pitch [@property getter]

The pitch of the sound.

volume
float volume [@property setter]
float volume [@property getter]

The volume of the sound.

position
Vector3f position [@property setter]
Vector3f position [@property getter]

The 3D position of the sound in the audio scene.

isLooping
bool isLooping [@property setter]
bool isLooping [@property getter]

Whether or not the stream should loop after reaching the end.

playingOffset
Duration playingOffset [@property setter]
Duration playingOffset [@property getter]

The current playing position (from the beginning) of the stream.

relativeToListener
bool relativeToListener [@property setter]
bool relativeToListener [@property getter]

Make the sound's position relative to the listener (true) or absolute (false).

minDistance
float minDistance [@property setter]
float minDistance [@property getter]

The minimum distance of the sound.

attenuation
float attenuation [@property setter]
float attenuation [@property getter]

The attenuation factor of the sound.

channelCount
uint channelCount [@property getter]

The number of channels of the stream.

sampleRate
uint sampleRate [@property getter]

The stream sample rate of the stream

status
Status status [@property getter]

The current status of the stream (stopped, paused, playing)

play
void play()

Start or resume playing the audio stream.

pause
void pause()

Pause the audio stream.

stop
void stop()

Stop playing the audio stream.

onGetData
bool onGetData(ref const(short)[] samples)

Request a new chunk of audio samples from the stream source.

onSeek
void onSeek(Duration timeOffset)

Change the current playing position in the stream source.

Meta