Skip to content

CrossFadeSoundClip

Overview

CrossFadeSoundClip is a sound generator that combines two sound clips and allows the user to set the relative mix - aka fade - between them. This can be useful in situations where there are a number of similar UI elements that need to have similar but somewhat distinct interaction sounds.

This was created specifically for the needs of the "Mean: Share and Balance" simulation, and there is at least one example of how it was intended to be used in that sim.

@author John Blanco (PhET Interactive Simulations)

Class CrossFadeSoundClip

import { CrossFadeSoundClip } from 'scenerystack/tambo';

Constructor

new CrossFadeSoundClip( audioBufferA : WrappedAudioBuffer, audioBufferB : WrappedAudioBuffer, providedOptions? : CrossFadeSoundClipOptions )

Instance Methods

play()

stop()

setPlaybackRate( playbackRate : number )

Instance Properties

crossFadeProperty : NumberProperty

(readonly)

Source Code

See the source for CrossFadeSoundClip.ts in the tambo repository.