Show / Hide Table of Contents

Class Sound

The persistent storage for sound variations and the most important audio source settings.

Inheritance
System.Object
Sound
Implements
IAudioClipContainer
ISerializationCallbackReceiver
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Stem
Assembly: Stem.dll
Syntax
[Serializable]
public class Sound : IAudioClipContainer, ISerializationCallbackReceiver

Properties

| Improve this Doc View Source

AttenuationMode

The attenuation mode defining how sound volume will be lowered over the distance.

Declaration
public AttenuationMode AttenuationMode { get; set; }
Property Value
Type Description
AttenuationMode

An enum value.

Remarks

Note that attenuation rules applies only for 3D sounds. Please refer to Unity Scripting Reference for details.

| Improve this Doc View Source

Audible

The flag indicating if the sound can be heard.

Declaration
public bool Audible { get; }
Property Value
Type Description
System.Boolean

True, if the sound can be heard. False otherwise.

Remarks

If the Bus is inaudible, the sound will also be inaudible.

| Improve this Doc View Source

AudioClipManagementMode

The audio clip management mode of the sound.

Declaration
public AudioClipManagementMode AudioClipManagementMode { get; set; }
Property Value
Type Description
AudioClipManagementMode

An enum value.

Remarks

This value is used only if OverrideAudioClipManagement flag is true.

| Improve this Doc View Source

AudioClipUnloadInterval

The audio clip unload interval of the sound.

Declaration
public float AudioClipUnloadInterval { get; set; }
Property Value
Type Description
System.Single

A time interval in seconds.

Remarks

This value is used only if OverrideAudioClipManagement flag is true and GetAudioClipManagementMode() return value is UnloadUnused.

| Improve this Doc View Source

Bank

The sound bank the sound belongs to.

Declaration
public SoundBank Bank { get; set; }
Property Value
Type Description
SoundBank

A reference to a sound bank.

| Improve this Doc View Source

Bus

The reference to a sound bus which will manage the sound.

Declaration
public SoundBus Bus { get; set; }
Property Value
Type Description
SoundBus

A reference to a sound bus.

Remarks

If set to null, DefaultBus will be used.

| Improve this Doc View Source

DopplerLevel

The parameter defining the Doppler scale for the sound.

Declaration
public float DopplerLevel { get; set; }
Property Value
Type Description
System.Single

Doppler scale of the sound. The value must be greater or equal to zero.

Remarks

This parameter duplicates corresponding parameter from AudioSource. Please refer to Unity Scripting Reference for details.

| Improve this Doc View Source

ID

The unique identifier for fast access to the sound.

Declaration
public int ID { get; }
Property Value
Type Description
System.Int32

A unique identifier value of the sound.

| Improve this Doc View Source

MaxDistance

The parameter defining the boundary outside which the sound will be inaudible or stop attenuating depending on AttenuationMode value.

Declaration
public float MaxDistance { get; set; }
Property Value
Type Description
System.Single

Distance in units.

Remarks

This parameter duplicates corresponding parameter from AudioSource. Please refer to Unity Scripting Reference for details.

| Improve this Doc View Source

MinDistance

The parameter defining the boundary within which the sound won't get any louder.

Declaration
public float MinDistance { get; set; }
Property Value
Type Description
System.Single

Distance in units.

Remarks

This parameter duplicates corresponding parameter from AudioSource. Please refer to Unity Scripting Reference for details.

| Improve this Doc View Source

Muted

The flag indicating if the sound is muted and can't be heard.

Declaration
public bool Muted { get; set; }
Property Value
Type Description
System.Boolean

True, if the sound is muted. False otherwise.

Remarks

This flag may be overridden by the Soloed flag, i.e. if the sound is simultaneously muted and soloed it'll be audible.

| Improve this Doc View Source

Name

The name of the sound. Used for fast search in corresponding sound bank.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

Name of the sound.

| Improve this Doc View Source

OverrideAudioClipManagement

The flag indicating whether the sound should use its own audio clip management mode and unload interval.

Declaration
public bool OverrideAudioClipManagement { get; set; }
Property Value
Type Description
System.Boolean

True, if the sound has overridden audio clip management and unload interval. False otherwise.

Remarks

This flag defines the behaviour of GetAudioClipManagementMode() and GetAudioClipUnloadInterval() methods.

If true, the sound will use its own AudioClipManagementMode and AudioClipUnloadInterval properties. Otherwise, SoundManagementMode and SoundUnloadInterval properties of the containing bank will be used.

| Improve this Doc View Source

PanStereo

The stereo panning parameter defining sound position in a stereo way (left or right).

Declaration
public float PanStereo { get; set; }
Property Value
Type Description
System.Single

Stereo pan of the sound. The value must be in [-1;1] range.

Remarks

This parameter duplicates corresponding parameter from AudioSource. Please refer to Unity Scripting Reference for details.

| Improve this Doc View Source

Soloed

The flag indicating if the sound is soloed. If set to true, all other non-solo sounds won't be audible.

Declaration
public bool Soloed { get; set; }
Property Value
Type Description
System.Boolean

True, if the sound is soloed. False otherwise.

Remarks

This flag may override the Muted flag, i.e. if the sound is simultaneously muted and soloed it'll be audible.

| Improve this Doc View Source

SpatialBlend

The spatial blend parameter defining how much the sound is affected by 3d spatialisation calculations (attenuation, doppler etc).

Declaration
public float SpatialBlend { get; set; }
Property Value
Type Description
System.Single

Spatial blend of the sound. The value must be in [0;1] range.

Remarks

This parameter duplicates corresponding parameter from AudioSource. Please refer to Unity Scripting Reference for details.

| Improve this Doc View Source

Spread

The parameter defining the spread angle (in degrees) of a 3d stereo or multichannel sound in speaker space.

Declaration
public float Spread { get; set; }
Property Value
Type Description
System.Single

Spread angle of the sound. The value must be in [0;360] range.

Remarks

This parameter duplicates corresponding parameter from AudioSource. Please refer to Unity Scripting Reference for details.

| Improve this Doc View Source

Unfolded

The flag indicating whether the sound bank inspector should show advanced settings for the sound.

Declaration
public bool Unfolded { get; set; }
Property Value
Type Description
System.Boolean

True, if advanced settings are shown. False otherwise.

Remarks

This property is used only by the sound bank inspector and does nothing during runtime.

| Improve this Doc View Source

VariationRetriggerMode

The retrigger mode defining how the sound will play variations.

Declaration
public RetriggerMode VariationRetriggerMode { get; set; }
Property Value
Type Description
RetriggerMode

An enum value.

| Improve this Doc View Source

Variations

The collection of sound variations.

Declaration
public ReadOnlyCollection<SoundVariation> Variations { get; }
Property Value
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<SoundVariation>

A reference to a read-only collection of sound variations.

Methods

| Improve this Doc View Source

AddVariation(AudioClip)

Adds a single sound variation to the sound.

Declaration
public SoundVariation AddVariation(AudioClip clip)
Parameters
Type Name Description
AudioClip clip

A reference to the audio clip with audio data.

Returns
Type Description
SoundVariation

A reference to a newly created sound variation.

| Improve this Doc View Source

AddVariations(AudioClip[])

Adds multiple sound variations (one per audio clip) to the sound.

Declaration
public void AddVariations(AudioClip[] clips)
Parameters
Type Name Description
AudioClip[] clips

An array of audio clips with audio data.

| Improve this Doc View Source

GetAudioClip(Int32)

Gets the audio clip at the specified index.

Declaration
public AudioClip GetAudioClip(int index)
Parameters
Type Name Description
System.Int32 index

The zero-based index of the audio clip to get.

Returns
Type Description
AudioClip

A reference to an audio clip.

| Improve this Doc View Source

GetAudioClipManagementMode()

Gets the audio clip management mode of the sound.

Declaration
public AudioClipManagementMode GetAudioClipManagementMode()
Returns
Type Description
AudioClipManagementMode

An enum value.

Remarks

If OverrideAudioClipManagement value is true, AudioClipManagementMode will be used. Otherwise, SoundManagementMode value of the containing bank will be used.

| Improve this Doc View Source

GetAudioClipUnloadInterval()

Gets the audio clip unload interval of the sound.

Declaration
public float GetAudioClipUnloadInterval()
Returns
Type Description
System.Single

The time interval in seconds.

Remarks

This value is only used if GetAudioClipManagementMode() return value is UnloadUnused

If OverrideAudioClipManagement value is true, AudioClipUnloadInterval will be used. Otherwise, SoundUnloadInterval value of the containing bank will be used.

| Improve this Doc View Source

GetNumAudioClips()

Gets the number of audio clips in the sound.

Declaration
public int GetNumAudioClips()
Returns
Type Description
System.Int32

The number of audio clips.

| Improve this Doc View Source

OnAfterDeserialize()

Prepares sound for runtime use after deserialization.

Declaration
public void OnAfterDeserialize()
Remarks

This method is automatically called by Unity during deserialization process. Don't call it manually.

| Improve this Doc View Source

OnBeforeSerialize()

Prepares sound for serialization.

Declaration
public void OnBeforeSerialize()
Remarks

This method is automatically called by Unity during serialization process. Don't call it manually.

Implements

IAudioClipContainer
ISerializationCallbackReceiver
  • Improve this Doc
  • View Source
Back to top Generated by DocFX