Skip to content

Loading local soundFont file #843

Answered by Danielku15
marriusco asked this question in Q&A
Discussion options

You must be logged in to vote

There are quite some risky and problematic things in your code you likely need to clean:

  • Reusing a for the link and later for the FileReader is risky.
  • const bytes = new Uint8Array([0]); is wrong. You are creating here a new byte array with one byte (value=0). You need to access .result of the FileReader to get the read array buffer.
  • I think it is also wrong to pass e into readAsArrayBuffer this function needs the Blob or File object which you want to read as buffer. I recommend building first an example where you are sure you have a proper ArrayBuffer or Uint8Array before proceeding with forwarding it to alphaTab. If you have problems there, I recommend StackOverflow to get guidance.
  • Acc…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marriusco
Comment options

Answer selected by Danielku15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants