04-25-2023, 08:35 AM
(04-24-2023, 06:37 PM)Petr Wrote: Hello,
I just released a new version of SaveSound in my thread. It can also do something that hasn't been here before - save sound in 24 bit Wav format. On that occasion, I discovered that both SndOpen and SndPlay can play the created 24-bit WAV file, but unfortunately, MemSound cannot handle it. This also follows from the help for MemSound, where only 8, 16, 32 bit formats are written about. I recently found out how to create a 24 bit format very easily and I'm assuming you didn't know about this option and that's why it wasn't known.
Well, there is a reason for that. _MEMSOUND uses the ELEMENTSIZE and TYPE members of _MEM to describe the audio data format. Unfortunately, there is nothing for 24-bits as you can see here (under TYPE values): _MEM - QB64 Phoenix Edition Wiki. It's the same reason _SNDNEW - QB64 Phoenix Edition Wiki is limited to 8, 16 and 32.
It is actually super easy to expose 24-bit audio data using _MEMSOUND, but we'll need to come up with a solution on how to expose this correctly. Probably we could just return 11000 or 0x18 in the TYPE member and 3, 6... for the ELEMENTSIZE (depending on the channels).
@DSMan195276, @RhoSigma, @SMcNeill thoughts?