Class SoundTrack
Constructors
constructor
-
Creates a new sound track.
Parameters
Optionalscene: Nullable<Scene>Define the scene the sound track belongs to
- options: ISoundTrackOptions = {}
Returns SoundTrack
Properties
id
The unique identifier of the sound track in the scene.
sound Collection
The list of sounds included in the sound track.
Methods
add Sound
connect To Analyser
-
Connect the sound track to an audio analyser allowing some amazing synchronization between the sounds/music and your visualization (VuMeter for instance).
Parameters
- analyser: Analyser
The analyser to connect to the engine
Returns void
- analyser: Analyser
dispose
-
Release the sound track and its associated resources
Returns void
remove Sound
set Volume
-
Set a global volume for the full sound track.
Parameters
- newVolume: number
Define the new volume of the sound track
Returns void
- newVolume: number
switch Panning Model To Equal Power
-
Switch the panning model to Equal Power: Represents the equal-power panning algorithm, generally regarded as simple and efficient. equalpower is the default value.
Returns void
switch Panning Model To HRTF
-
Switch the panning model to HRTF: Renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects.
Returns void
It could be useful to isolate your music & sounds on several tracks to better manage volume on a grouped instance of sounds. It will be also used in a future release to apply effects on a specific track.
See
https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic#using-sound-tracks