11-01-2022, 01:59 AM
Unfortunately you can't yet do this, we actually have a related GitHub issue around it here. Basically the problem is that while you can use
That said, that's probably more complexity than you actually need, it would be better for you if we had a
_MEMSOUNDto manipulate an existing sound buffer (and thus could make use of that to write your embedded sound into it), there's no way to make a new sound buffer that doesn't involve having a file of the correct length already existing. The GitHub issue I linked is about adding a new command to create an "empty" sound buffer of a particular length, which you could then write to and play all from memory without having to touch any files.
That said, that's probably more complexity than you actually need, it would be better for you if we had a
_SNDOPENBUFFERtype of command that just takes a string that already contains the file contents for the sound you want to play. That has the advantage that you don't need to decode the sound yourself, you could store a regular mp3 (or similar) in your exe and play it directly. I would recommend making a GitHub issue around this and we could discuss it further, I'd have to go look but I imagine it's fairly doable.