resetSoundFonts
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.
- JavaScript
- C#
- Kotlin
resetSoundFonts(): void
void ResetSoundFonts()
fun resetSoundFonts(): Unit
Examples​
- JavaScript
- C#
- Android
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);
var api = new AlphaTabApi<MyControl>(...);
api.LoadSoundFont(System.IO.File.OpenRead("guitars.sf2"), true);
api.LoadSoundFont(System.IO.File.OpenRead("pianos.sf2"), true);
...
api.ResetSoundFonts();
api.LoadSoundFont(System.IO.File.OpenRead("synths.sf2"), true);
val api = AlphaTabApi<MyControl>(...)
api.loadSoundFont(readResource("guitars.sf2"), true)
api.loadSoundFont(readResource("pianos.sf2"), true)
...
api.resetSoundFonts()
api.loadSoundFont(readResource("synths.sf2"), true)