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

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.

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​

var 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);
var at = $('#alphaTab');
var tracks = at.alphaTab('tracks');
at.alphaTab('trackVolume', [tracks[0], tracks[1]], 1.5);
at.alphaTab('trackVolume', [tracks[0], tracks[1]], 0.5);
var api = new AlphaTabApi<MyControl>(...);
api.ChangeTrackVolume(new Track[] { api.Score.Tracks[0], api.Score.Tracks[1] }, 1.5);
api.ChangeTrackVolume(new Track[] { api.Score.Tracks[2] }, 0.5);