Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    SoundBase Class

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

    Base class for a Sound content.

    System.Object → DisposeBase → ComponentBase → SoundBase
    Derived from SoundBase: Sound StreamedBufferSound

    public abstract class SoundBase : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
    Remarks

    Sound is played with a SoundInstance.

    Name Description
    Fields
    intancesCreationCount

    The number of Instances Created so far by this SoundEffect. Used only to give a unique name to the SoundEffectInstance.

    Properties
    TotalLength

    Gets the total length in time of the Sound.

    Methods
    CreateInstance(AudioListener, Boolean, Single, HrtfEnvironment)

    Create a new sound effect instance of the sound effect. Each instance that can be played and localized independently from others.

    Destroy()

    Destroys the instance.

    GetCountChannels()
    RegisterInstance(SoundInstance)

    Register a new instance to the soundEffect.

    | Improve this Doc View Source

    Fields


    intancesCreationCount

    The number of Instances Created so far by this SoundEffect. Used only to give a unique name to the SoundEffectInstance.

    protected int intancesCreationCount
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Properties


    TotalLength

    Gets the total length in time of the Sound.

    public TimeSpan TotalLength { get; }
    Property Value
    Type Description
    System.TimeSpan
    | Improve this Doc View Source

    Methods


    CreateInstance(AudioListener, Boolean, Single, HrtfEnvironment)

    Create a new sound effect instance of the sound effect. Each instance that can be played and localized independently from others.

    public abstract SoundInstance CreateInstance(AudioListener listener = null, bool useHrtf = false, float directionalFactor = 0F, HrtfEnvironment environment = HrtfEnvironment.Small)
    Parameters
    Type Name Description
    AudioListener listener
    System.Boolean useHrtf
    System.Single directionalFactor
    HrtfEnvironment environment
    Returns
    Type Description
    SoundInstance

    A new sound instance

    Exceptions
    Type Condition
    System.ObjectDisposedException

    The sound has already been disposed


    Destroy()

    Destroys the instance.

    protected override void Destroy()
    Overrides
    ComponentBase.Destroy()

    GetCountChannels()

    public int GetCountChannels()
    Returns
    Type Description
    System.Int32

    RegisterInstance(SoundInstance)

    Register a new instance to the soundEffect.

    protected void RegisterInstance(SoundInstance instance)
    Parameters
    Type Name Description
    SoundInstance instance

    new instance to register.


    Inherited Members

    ComponentBase.Tags
    ComponentBase.Name
    ComponentBase.ICollectorHolder.Collector
    ComponentBase.OnNameChanged()
    ComponentBase.ToString()
    DisposeBase.Dispose()
    DisposeBase.IsDisposed
    DisposeBase.IReferencable.ReferenceCount
    DisposeBase.IReferencable.AddReference()
    DisposeBase.IReferencable.Release()
    DisposeBase.OnAddReference()
    DisposeBase.OnReleaseReference()

    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