Learn / Documentation / Script Reference / SoundGroupData

SoundGroupData

class in Doozy.Engine.Soundy / Inherits from: ScriptableObject

Description

Contains all the relevant info needed by Soundy to play the referenced sounds in a managed way
See Also: SoundDatabase

Properties

  • public bool HasMissingAudioClips – Returns TRUE if this SoundGroupData is either empty or has at least one null (or missing) AudioClip reference. If set to ‘No Sound’, returns FALSE

  • public bool HasSound – Returns TRUE if this SoundGroupData has at least one AudioClip referenced. If set to ‘No Sound’, returns FALSE

  • public float RandomPitch – Returns a random pitch value between 0f and 4f

  • public float RandomVolume – Returns a random volume value between 0f and 1f

Public Variables

  • public string DatabaseName – The SoundDatabase name this SoundGroupData belongs to

  • public string SoundName – Sound name as defined in the database. This is set by default as the first AudioClip name

  • public bool IgnoreListenerPause – Allows this SoundGroupData to play even though AudioListener.pause is set to true. This is useful for the menu element sounds or background music in pause menus

  • public RangedFloat Volume – The custom volume interval of the AudioSource in decibels (-80dB to 0dB). Every time a clip is played, a random value from the 0f – 1f interval will get set to the AudioSource.

  • public RangedFloat Pitch – The pitch interval for the AudioSource in semitones (-24 to 24). Every time a clip is played, a random value from the 0f – 4f interval will get set to the AudioSource.

  • public float SpatialBlend – Sets how much this AudioSource is affected by 3D space calculations (attenuation, doppler etc). 0.0 makes the sound full 2D, 1.0 makes it full 3D

  • public bool Loop – Play in a loop?

  • public PlayMode Mode – Sets the rules for playing the referenced ~AudioClips~

  • public bool ResetSequenceAfterInactiveTime – If Mode is set to PlayMode.Sequence and this flag is set to TRUE, then the play sequence will get automatically reset after an inactive time has passed since the last played sound

  • public float SequenceResetTime – If Mode is set to PlayMode.Sequence and the ResetSequenceAfterInactiveTimeflag is set to TRUE, this is the time period that needs to pass in order for the sequence to reset itself and start playing again from the first entry. Note that the time is measured from the time a sound starts to play, not when it ends

  • public List<AudioData> Sounds – List of AudioData that are available to play

Public Methods

  • public SoundyController Play(Transform followTarget, AudioMixerGroup outputAudioMixerGroup = null) – Plays one of the sounds from the AudioClip list, with the set randomized values, and also tells the controller that it has a target transform it needs to follow while playing

  • public SoundyController Play(Vector3 position, AudioMixerGroup outputAudioMixerGroup = null) – Plays one of the sounds from the AudioClip list, with the set randomized values, at the specified position

  • public void PlaySoundPreview(AudioSource audioSource, AudioMixerGroup outputAudioMixerGroup, AudioClip audioClip) – [Editor Only] Plays a sound preview in the Editor

  • public void PlaySoundPreview(AudioSource audioSource, AudioMixerGroup outputAudioMixerGroup) – [Editor Only] Plays a sound preview in the Editor

  • public void StopSoundPreview(AudioSource audioSource) – [Editor Only] Stops the sound preview on the target AudioSource

  • public void SetDirty(bool saveAssets) – [Editor Only] Marks target object as dirty. (Only suitable for non-scene objects)