Skip to main content

changeTrackVolume

since 0.9.4

Description​

Changes the volume of the given tracks. This will result in a volume change of the primary and secondary midi channel that the track uses for playback. If the track shares the channels with another track, all related tracks will be changed as they cannot be distinguished.

changeTrackVolume(tracks: Track[], volume: number): void
ParameterSummary
tracksAll

The tracks for which the volume should be changed.

volumeAll

The volume to set for all tracks in percent (0-1)

Examples​

const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.changeTrackVolume([api.score.tracks[0], api.score.tracks[1]], 1.5);
api.changeTrackVolume([api.score.tracks[2]], 0.5);