09-02-2023, 08:22 PM
(09-02-2023, 07:17 PM)SagaraS Wrote: The Music.mid is in an archive at offset address &H400.In addition to what the others have said about QB64-PE's native MIDI support (using `$Unstable:Midi` and `$MidiSoundFont`), QB64-PE also has the ability to load music files (such as MIDI) from a string rather than a file, see the notes on using the `"MEMORY"` capability with _SNDOPEN.
For example, I want to load the data into an array and send it to an API like Winmm. Is that possible? And if so how?
Point being, you can open your archive file yourself, seek to `&H400` and read the contents of `Music.mid` into a `String`, and then pass that `String` directly to `_SNDOPEN` to be able to play it. Doing it that lets you play the sound without `Music.mid` being in a separate file. You can see an example of this at the bottom of the `_SNDOPEN` page, it reads the sound from `DATA` statements rather than from within a separate file but the concept is the same.