Produces a decompressed version of a packed soundfont.
BOOL BASS_MIDI_FontUnpack(
HSOUNDFONT handle,
void *outfile,
DWORD flags
);
| handle | The soundfont to unpack. | ||
| outfile | Filename for the unpacked soundfont. | ||
| flags | Any combination of these flags.
|
| BASS_ERROR_HANDLE | handle is not valid. |
| BASS_ERROR_NOTAVAIL | The soundfont is not packed. |
| BASS_ERROR_INIT | BASS_Init has not been successfully called - it needs to be to decode the samples. |
| BASS_ERROR_CODEC | The appropriate add-on to decode the samples is not loaded. |
| BASS_ERROR_CREATE | Could not create the output file, outfile. |
| BASS_ERROR_UNKNOWN | Some other mystery problem! |
A soundfont should not be unpacked while it is being used to render any MIDI streams, as that could delay the rendering.
BASS_MIDI_FontGetInfo can be used to check if a soundfont is packed.
BASS_PluginLoad("bassflac.dll", 0); // load FLAC plugin
HSOUNDFONT handle = BASS_MIDI_FontInit("afile.sf2pack", 0); // open soundfont
BASS_MIDI_FontUnpack(handle, "afile.sf2", 0); // produce unpacked version