Author Topic: BASS_MIDI_FontInit() from ByteBuffer, error 20  (Read 159 times)

gicci

  • Posts: 121
After upgrading to the latest BASSMIDI version I am unable to load a SF2 file from a ByteBuffer:

Code: [Select]
BASS_MIDI_FontInit() called with: file = [java.nio.DirectByteBuffer[pos=5671354 lim=5671360 cap=5671360]], flags = [0]
BASS_MIDI_FontInit() returned: 0
BASS_ErrorGetCode() called
BASS_ErrorGetCode() returned: 20

At the beginning I thought it was due to the fact that I was specifying BASSMIDI.BASS_MIDI_FONT_NOLIMITS, but even removing it and setting the flag to 0, I still get error 20.

The same code works with the previous beta version of the library I was using (2.4.14.25).

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: BASS_MIDI_FontInit() from ByteBuffer, error 20
« Reply #1 on: 14 Oct '24 - 12:32 »
Oops! That is indeed broken. An update (2.4.15.1) to fix it is up on the BASS page now, so please re-download.

gicci

  • Posts: 121
Re: BASS_MIDI_FontInit() from ByteBuffer, error 20
« Reply #2 on: 14 Oct '24 - 18:32 »
Thank you, now it works perfectly.  :)

Another related question: is there a specific reason why the flag BASS_MIDI_FONT_NOSBLIMITS is not available with BASS_MIDI_FontInitUser() ?

Ian @ un4seen

  • Administrator
  • Posts: 26172
Re: BASS_MIDI_FontInit() from ByteBuffer, error 20
« Reply #3 on: 15 Oct '24 - 12:06 »
The BASS_MIDI_FONT_NOSBLIMITS flag is supported by BASS_MIDI_FontInitUser, but I see that wasn't mentioned in the documentation. It is now :)