Table of Contents

Interface IPlayableSound

Namespace
Stride.Audio
Assembly
Stride.Audio.dll

Interface for a playable sound. A playable sound can loop (ref IsLooping), be played (ref Play()), be paused (ref Pause()), be resumed (ref Play()), be stopped (ref Stop()) and be attenuated (ref Volume). To query the current state of a sound use the PlayState property. To stop a sound after its currently loop set IsLooping = false;

public interface IPlayableSound

Properties

IsLooping

Gets or sets whether the sound is automatically looping from beginning when it reaches the end.

bool IsLooping { get; set; }

Property Value

bool

PlayState

The current state of the sound.

PlayState PlayState { get; }

Property Value

PlayState

Volume

The global volume at which the sound is played.

float Volume { get; set; }

Property Value

float

Remarks

Volume is ranging from 0.0f (silence) to 1.0f (full volume). Values beyond those limits are clamped.

Methods

Pause()

Pause the sounds.

void Pause()

Remarks

A call to Pause when the sound is already paused or stopped has no effects.

Play()

Start or resume playing the sound.

void Play()

Remarks

A call to Play when the sound is already playing has no effects.

Stop()

Stop playing the sound immediately and reset the sound to the beginning of the track.

void Stop()

Remarks

A call to Stop when the sound is already stopped has no effects