Skip to main content

resetSoundFonts

since 0.9.4

Description​

Unloads all presets from previously loaded SoundFonts. 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.

resetSoundFonts(): void

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