Sound playback from embedded data
#3
(10-31-2022, 11:24 PM)King Mocker Wrote: I'm wondering if someone can advise on solution for a problem I'm having.
I am writing a program and would like to make it as a standalone/self-contained .exe, without any extra files being required.
Welcome to the forums. Are you sure you want to do this? Because the EXE files are going to be really large and users are known to complain about a c. 1MB EXE file only to print "HELLO, WORLD!" out of this programming system.

If the wave files are few and short, this might be a good idea of yours. Notice that if you try to use a low sampling rate like 22050Hz this programming system might resample them to 44100Hz or whatever the sound card supports. "Might" because I remember QB64 v0.98 had some code for changing the sampling rate of some wave file, to play it back through "_SNDRAW" or something like that.

One good thing is that a "lossy" format file like OGG could be converted to PCM data by QB64PE, so all that needs to be done is to transfer a "_MEMSOUND" buffer into a string and then use "_DEFLATE$". @Dav 's routine was necessary because the string could contain some nasty control characters especially the ASCII0 that some programs cannot handle well.

Now I don't know how to "put it back" in a way supported by QB64PE, might have to fiddle directly with the "SOUND" field in "_MEM" UDT.
Reply


Messages In This Thread
RE: Sound playback from embedded data - by Pete - 10-31-2022, 11:38 PM
RE: Sound playback from embedded data - by mnrvovrfc - 11-01-2022, 12:03 AM



Users browsing this thread: 4 Guest(s)