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.

Signatures​

function changeTrackVolume(tracks, volume)JavaScript
void ChangeTrackVolume(Track[] tracks, double volume).net
alphaTab('trackVolume', tracks, volume)jQuery
fun changeTrackVolume(tracks: alphaTab.collections.List<alphaTab.model.Track>, volume: Double): UnitAndroid

Parameters​

ParametersTypeSummary
tracksJavaScriptalphaTab.model.Tracks[]

The array of tracks that should be changed.

tracks.netAlphaTab.Model.Tracks[]

The array of tracks that should be changed.

tracksAndroidalphaTab.collections.List<alphaTab.model.Track>

The array of tracks that should be changed.

volumeAlldouble

The volume multiplicator that should be added to the volume that the track normally has. e.g. 1.0 for no change on the volume, 2.0 for doubling the volume. Allowed range: 0.0 - 3.0.

Returns​

Nothing

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);