QB64Team / qb64

BASIC for the modern era.
https://www.qb64.org
Other
672 stars 96 forks source link

We need some kind of _NEWSND function to make sound buffers #228

Open a740g opened 2 years ago

a740g commented 2 years ago

I noticed that we have a _NEWIMAGE that lets us do the same for images, but nothing for sound. I am aware of _SNDRAW & _SNDOPENRAW, but that does not serve my purpose. What I really want is a sound buffer that can be created programmatically and filled with custom sample data to be reused later multiple times. Something like:

soundHandle& = _NEWSND(sampleRate&, sampleBits&, sampleChannels&)

We can then get access to the buffer by using _MEMSOUND[(soundHandle&, channel%)].

If there is a way to do this currently in QB64 (without using external libs or hacks) then please let me know.