Namespace: Un4seen.Bass.AddOn.Midi
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.2
[DllImportAttribute("bassmidi")] public static bool BASS_MIDI_StreamLoadSamples( int handle )
Parameters
- handle
- Type: SystemInt32
The MIDI stream handle.
Return Value
Type: BooleanIf successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Samples are normally loaded as they are needed while rendering a MIDI stream, which can result in CPU spikes, particularly with packed soundfonts. That generally won't cause any problems, but when smooth/constant performance is critical this function can be used to preload the samples before rendering, so avoiding the need to load them while rendering.
Preloaded samples can be compacted/unloaded just like any other samples, so it is probably wise to disable the BASS_CONFIG_MIDI_COMPACT option when preloading samples, to avoid any chance of the samples subsequently being automatically unloaded.
This function should not be used while the MIDI stream is being rendered, as that could interrupt the rendering.
ERROR CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not valid. |
BASS_ERROR_NOTAVAIL | The stream is for real-time events only, so it's not possible to know what presets are going to be used. Use BASS_MIDI_FontLoad(Int32, Int32, Int32) instead. |