changeTrackVolume
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​
Parameters | Type | Summary |
---|---|---|
tracksJavaScript | alphaTab.model.Tracks[] | The array of tracks that should be changed. |
tracks.net | AlphaTab.Model.Tracks[] | The array of tracks that should be changed. |
tracksAndroid | alphaTab.collections.List<alphaTab.model.Track> | The array of tracks that should be changed. |
volumeAll | double | 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​
- JavaScript
- jQuery
- C#
- Android
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);
const at = $('#alphaTab');
const 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);
val api = AlphaTabApi<MyControl>(...);
api.changeTrackVolume(alphaTab.collections.List<alphaTab.model.Track>(api.score.tracks[0], api.score.tracks[1]), 1.5);
api.changeTrackVolume(alphaTab.collections.List<alphaTab.model.Track>(api.score.tracks[2]), 0.5);