11-02-2024, 06:27 PM
Hi. For the first question - that delay will be caused by audio decoding to RAM. So I recommend that you first record all the sounds in the memory to the field via SndOpen and then start them as needed.
To the second question - of course yes, but it will be a gigantic increase in the size of the source code. For this purpose, use Base64, it is somewhere on the forum. That's one possibility. But why on earth do you want to use WAV for this purpose? Use MP3 or another compression format. After decoding with SndOpen, it can be run directly without intermediate saving to disk with the SndOpen command with the "memory" parameter (I read it somewhere, better check it), I haven't tried it. Just encode a track in MP3 format as a string in Base64 format, you can then insert it as a string into the source code without any problems, because Base64 uses 6-bit encoding - so the characters you normally write in the IDE, so it's compatible. Subsequently, you load this string, decode it from a string in Base64 format into a normal string in binary format, and pass this string to the SndOpen function.
Regarding the third question - of course it is possible. Would you like an example of how to write a loader?
On the last question - currently there is no tool in QB64 that can convert WAV format to MP3 format. I've dabbled with it a bit in the past - and it's pretty crazy. Converting it, that is the true pinnacle of programming art. I can't even think about that.
Hey, bet there's going to be a post in a moment, from someone who writes: Convert WAV to MP3? I wrote this years ago...and here is it...
To the second question - of course yes, but it will be a gigantic increase in the size of the source code. For this purpose, use Base64, it is somewhere on the forum. That's one possibility. But why on earth do you want to use WAV for this purpose? Use MP3 or another compression format. After decoding with SndOpen, it can be run directly without intermediate saving to disk with the SndOpen command with the "memory" parameter (I read it somewhere, better check it), I haven't tried it. Just encode a track in MP3 format as a string in Base64 format, you can then insert it as a string into the source code without any problems, because Base64 uses 6-bit encoding - so the characters you normally write in the IDE, so it's compatible. Subsequently, you load this string, decode it from a string in Base64 format into a normal string in binary format, and pass this string to the SndOpen function.
Regarding the third question - of course it is possible. Would you like an example of how to write a loader?
On the last question - currently there is no tool in QB64 that can convert WAV format to MP3 format. I've dabbled with it a bit in the past - and it's pretty crazy. Converting it, that is the true pinnacle of programming art. I can't even think about that.
Hey, bet there's going to be a post in a moment, from someone who writes: Convert WAV to MP3? I wrote this years ago...and here is it...
![Smile Smile](https://qb64phoenix.com/forum/images/smilies/smile.png)