Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    IPlayableSound Interface

    Namespace: Stride.Audio
    Assembly: Stride.Audio.dll

    Interface for a playable sound. A playable sound can loop (ref ), 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 use

    public interface IPlayableSound
    Name Description
    Properties
    IsLooping

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

    PlayState

    The current state of the sound.

    Volume

    The global volume at which the sound is played.

    Methods
    Pause()

    Pause the sounds.

    Play()

    Start or resume playing the sound.

    Stop()

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

    | Improve this Doc View Source

    Properties


    IsLooping

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

    bool IsLooping { get; set; }
    Property Value
    Type Description
    System.Boolean

    PlayState

    The current state of the sound.

    PlayState PlayState { get; }
    Property Value
    Type Description
    PlayState

    Volume

    The global volume at which the sound is played.

    float Volume { get; set; }
    Property Value
    Type Description
    System.Single
    Remarks

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

    | Improve this Doc View Source

    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


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation