resetSoundFonts
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​
Type | Values |
---|---|
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​
- JavaScript
- jQuery
- 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);
$('#alphaTab').alphaTab('loadSoundFont', '/assets/guitars.sf2', true);
$('#alphaTab').alphaTab('loadSoundFont', '/assets/pianos.sf2', true);
...
$('#alphaTab').alphaTab('resetSoundFonts');
$('#alphaTab').alphaTab('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)