Skip to main content

resetSoundFonts

since 0.9.4

Description​

This function resets the player internally to not have any SoundFont loaded anymore. This allows you to reduce the memory usage of the page if multiple partial SoundFonts are loaded via loadSoundFont(..., true). Depending on the workflow you might also just want to use loadSoundFont(..., false) once instead of unloading the previous SoundFonts.

Signatures​

TypeValues
function resetSoundFonts()JavaScript

Unloads all presets from the previous loaded SoundFonts.

void ResetSoundFonts().net

Unloads all presets from the previous loaded SoundFonts.

fun resetSoundFonts(): UnitAndroid

Unloads all presets from the previous loaded SoundFonts.

Parameters​

None

Examples​

const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.loadSoundFont('/assets/guitars.sf2', true);
api.loadSoundFont('/assets/pianos.sf2', true);
// ..
api.resetSoundFonts();
api.loadSoundFont('/assets/synths.sf2', true);