My Lunar Lander bloatware! (ver 0.33)
#11
I added the t to show you that the sound still plays as the loop continues. The biggest different between original QBasic SOUND and PLAY and QB64 is that QB64 uses your Sound Card and speakers. QBasic used your internal speaker inside your computer.
Reply
#12
(07-25-2022, 11:06 PM)mnrvovrfc Wrote: You're better off at least using "_SNDOPEN", "_SNDPLAY", "_SNDSTOP", "_SNDVOL", "_SNDPLAYING" and "_SNDCLOSE", with external audio files. They could be in MP3 or OGG format which could be very small if one-channel and maybe 22050Hz sampling rate. Might want to take advantage of "_INFLATE" and "_MEMSOUND" to even include such a file into your source code. Otherwise "_SNDRAW" is the only way to start and stop sound at will.

This is the conclusion I'm coming to as well.
I like the idea of including the file in the source code.
Or at least having my app programmatically create the WAV file on the fly, if it isn't found in the program's folder. The generate WAV code @Steffan-68 posted at
https://staging.qb64phoenix.com/showthre...88#pid4388

works, and with a little (or a lot?) buckling down and reading the WAV file specification and the various articles about it that I have linked to, I probably can get it to generate the sounds I'm looking for (basically the rumbling spaceship engine sound and explosions like in the original arcade Asteroids and Lunar Lander games by Atari). Those are just white noise at a lower frequency, and fading the volume for an explosion sound. Someone (maybe you?) said try random instead of sine wave for white noise, which sounds like a start, so I have something to go on at least.

(07-25-2022, 11:06 PM)mnrvovrfc Wrote: I have to check out "_MEMSOUND" myself, but I'm not very comfortable programming for the "_MEM" gang. That statement is a lot like "Catchsound" in Purebasic, made it rather easy to bind media files into an EXE file. Sadly it might be for Windows only unless QB64 could recognize "zlib" on Linux.

I too am not too comfortable with "_MEM" type stuff, and would prefer my program be cross-platform, but for now if I can get it to make the sound I want and start/stop it on demand without pops or clicks, under ANY operating system, I'd count that as progress!
Reply




Users browsing this thread: 1 Guest(s)