Interface PlaySoundConfig

Configuration for the Audio Source that will play your Audio Clip.

interface PlaySoundConfig {
    audioSourceTemplate?: GameObject;
    dopplerLevel?: number;
    loop?: boolean;
    maxDistance?: number;
    minDistance?: number;
    mixerGroup?: AudioMixerGroup;
    panStereo?: number;
    pitch?: number;
    rollOffMode?: AudioRolloffMode;
    rolloffCustomCurve?: AnimationCurve;
    volumeScale?: number;
}

Properties

audioSourceTemplate?: GameObject

This should be a Game Object with an Audio Source on it. Normally Audio Manager creates a new Audio Source to play your sound, but if you provide this template we will clone it and play your sound from this object. All other config properties work on top of this (for example if you supply volumeScale that will override the volume of your Audio Source).

dopplerLevel?: number

Defaults to 0.

loop?: boolean

Sets wether Audio Source will play looped. If true Audio Manager will not clean up your Audio Source automatically (you will need to destroy it when you no longer need the sound).

maxDistance?: number

Sets the max distance of the Audio Source.

minDistance?: number

Sets the min distance of the Audio Source.

mixerGroup?: AudioMixerGroup

Mixer group for sound to play in.

panStereo?: number

Sets the stereo pan of the Audio Source.

pitch?: number

Sets the pitch of the Audio Source.

rollOffMode?: AudioRolloffMode

Sets the roll off mode of the Audio Source.

rolloffCustomCurve?: AnimationCurve

Sets a custom animation curve rolloff for the Audio Source. This will override rollOffMode.

volumeScale?: number

Sets the volume of the Audio Source.