A utility class to mix between two sounds.
Kind: global class
SoundInstance
SoundInstance
Number
Create the sound mixer.
Param | Type | Description |
---|---|---|
sound1 | SoundInstance |
Sound to mix from. Can be null to just fade in. |
sound2 | SoundInstance |
Sound to mix to. Can be null to just fade out. |
allowOverlapping | Boolean |
If true (default), will mix while overlapping sounds. If false, will first finish first sound before begining next. |
SoundInstance
Get first sound.
Kind: instance property of SoundMixer
Returns: SoundInstance
- First sound instance.
SoundInstance
Get second sound.
Kind: instance property of SoundMixer
Returns: SoundInstance
- Second sound instance.
Number
Return current progress.
Kind: instance property of SoundMixer
Returns: Number
- Mix progress from 0 to 1.
Stop both sounds.
Kind: instance method of SoundMixer
Update the mixer progress with time delta instead of absolute value.
Kind: instance method of SoundMixer
Param | Type | Description |
---|---|---|
delta | Number |
Progress delta, in seconds. |
Update the mixer progress.
Kind: instance method of SoundMixer
Param | Type | Description |
---|---|---|
progress | Number |
Transition progress from sound1 to sound2. Values must be between 0.0 to 1.0. |