Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    Sound Class

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

    Sound content.

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

    [ContentSerializer(typeof(DataContentSerializer<Sound>))]
    [DataSerializerGlobal(typeof(ReferenceSerializer<Sound>), null, DataSerializerGenericMode.None, false, false, Profile = "Content")]
    [DataSerializer(typeof(SoundSerializer))]
    public sealed class Sound : SoundBase, IDisposable, IComponent, IReferencable, ICollectorHolder
    Remarks

    Sound is played with a SoundInstance.

    Name Description
    Methods
    CreateInstance(AudioListener, Boolean, Boolean, Single, HrtfEnvironment)

    Create a new sound effect instance of the sound effect. The audio data are shared between the instances so that useless memory copies is avoided. Each instance that can be played and localized independently from others.

    CreateInstance(AudioListener, Boolean, Single, HrtfEnvironment)
    Destroy()
    | Improve this Doc View Source

    Methods


    CreateInstance(AudioListener, Boolean, Boolean, Single, HrtfEnvironment)

    Create a new sound effect instance of the sound effect. The audio data are shared between the instances so that useless memory copies is avoided. Each instance that can be played and localized independently from others.

    public SoundInstance CreateInstance(AudioListener listener = null, bool forceLoadInMemory = false, bool useHrtf = false, float directionalFactor = 0F, HrtfEnvironment environment = HrtfEnvironment.Small)
    Parameters
    Type Name Description
    AudioListener listener
    System.Boolean forceLoadInMemory
    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


    CreateInstance(AudioListener, Boolean, Single, HrtfEnvironment)

    public override 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
    Overrides
    SoundBase.CreateInstance(AudioListener, Boolean, Single, HrtfEnvironment)

    Destroy()

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

    Inherited Members

    SoundBase.TotalLength
    SoundBase.GetCountChannels()
    SoundBase.RegisterInstance(SoundInstance)
    SoundBase.intancesCreationCount
    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