Hi guys, maybe this is obvious, but not to me. The motivation here is to cobble together a music player, shamelessly plagiarizing Fellippe's and Petr's code, which will play .wav and all other music files correctly.
Is it possible to load a sound file, say SoundFile$, and then have QB64 automatically determine to what subroutine to send that file, based on its extension?
Something along these lines:
INPUT "Enter path and sound file name with extension -> ", SoundFile$
(Appropriate error notifications if file is unavailable)
IF SoundFile$ = "*.wav" THEN
CALL PetrSubroutine
CALL NiceWavGraphicsSubroutine
ELSE
CALL FellippeSubroutine
CALL NiceGraphicsSubroutine
END IF
That wildcard * is just notional. It doesn't work. It's easy enough to have the user explicitly say whether the sound file is .wav or not, but that's rather brute force.
(Note that as of now, it looks like _SNDOPEN, _SNDLEN, and _SNDGETPOS don't work at all, with these 24-bit or 32-bit, or whatever they are .wav files. That's why I don't think my time bar will work with Petr's latest creation. To duplicate the display, I'll have to figure out how to obtain the length of the music clip, and the current position while it's playing.)
Thanks!!