Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Playing sound files in QB45
#1
Hi,

I am attaching code a file called Playtest.bas in a .zip file which contains some .wav files..

This program uses QB45 and QB71 to play .wav files and 
I am not stating Playtest.bas works in QB64 because of some reason about the OUT function concerning access to the DSP.

My question is how to write an .mp3 BASIC function in QB45..
I know QB64 supports .wav files in _SndPlay but that is not what I am posting here..

Erik.


Attached Files
.zip   PLAYTEST.ZIP (Size: 151.18 KB / Downloads: 8)
Reply
#2
The good folks on the QB64PE team were good enough to include it for you.

Start reading here:
https://qb64phoenix.com/qb64wiki/index.php/SNDOPEN

    https://qb64phoenix.com/qb64wiki/index.php/SNDPLAY

https://qb64phoenix.com/qb64wiki/index.php/SNDCLOSE

_SNDPLAY works with .WAV, .AIFF, MP3, M4A, MP4 & Others.

I think it even works with MIDI (but you have to mess around with SNDFONTS for that, I haven't done it yet.
Reply
#3
(01-04-2025, 05:58 AM)ahenry3068 Wrote: The good folks on the QB64PE team were good enough to include it for you.

Start reading here:
https://qb64phoenix.com/qb64wiki/index.php/SNDOPEN

    https://qb64phoenix.com/qb64wiki/index.php/SNDPLAY

https://qb64phoenix.com/qb64wiki/index.php/SNDCLOSE

_SNDPLAY works with .WAV, .AIFF, MP3, M4A, MP4 & Others.

I think it even works with MIDI (but you have to mess around with SNDFONTS for that,  I haven't done it yet.
I don't want to do it in QB64 I want to do it in QB45/QB71..
Reply
#4
(01-04-2025, 06:16 AM)eoredson Wrote:
(01-04-2025, 05:58 AM)ahenry3068 Wrote: The good folks on the QB64PE team were good enough to include it for you.

Start reading here:
https://qb64phoenix.com/qb64wiki/index.php/SNDOPEN

    https://qb64phoenix.com/qb64wiki/index.php/SNDPLAY

https://qb64phoenix.com/qb64wiki/index.php/SNDCLOSE

_SNDPLAY works with .WAV, .AIFF, MP3, M4A, MP4 & Others.

I think it even works with MIDI (but you have to mess around with SNDFONTS for that,  I haven't done it yet.
I don't want to do it in QB64 I want to do it in QB45/QB71..

Ohhh.   I should have read more closely.     Smile...   My bad !!.       That's a whole other ball of wax.     What machine do you plan on writing this on ?    I think it should work on at least a fast 486. But anything slower than that is going to be a chore.  QB45/QB71 are not the most efficient compilers.    It may be a better approach to find a linkable library written in C or Pascal.
and just link it in to your program.    I found this for MS-Dos (written in C,  GPL code)  --> https://www.forfoss.com/mpxplay-32-bit-c...d-windows/

Also some other stuff https://www.bttr-software.de/freesoft/so...mp3players.    Most of the stuff seems to want to run in Dos protected mode.    I don't think Microsoft ever added that capability to the Dos BASIC compilers.   You may be able to find something here that will work with SHELL.
Reply
#5
I've been searching for a bit now.   I can't find mp3 decoding stuff written in ANY BASIC dialect.     I really can't imagine that no one has ever at least tried to do this.  I just can't seem to find anything.
Reply
#6
(01-04-2025, 12:37 PM)ahenry3068 Wrote: I've been searching for a bit now.   I can't find mp3 decoding stuff written in ANY BASIC dialect.     I really can't imagine that no one has ever at least tried to do this.  I just can't seem to find anything.

This count? -  morphx666/vbMP3decoder: MP3 decoding library written in VB.NET
Reply
#7
(01-04-2025, 12:37 PM)ahenry3068 Wrote: I really can't imagine that no one has ever at least tried to do this.  I just can't seem to find anything.
That may take about three hundred years . . . maybe  sooner. One should never give up hope.  Big Grin
Reply
#8
(01-04-2025, 02:57 PM)a740g Wrote:
(01-04-2025, 12:37 PM)ahenry3068 Wrote: I've been searching for a bit now.   I can't find mp3 decoding stuff written in ANY BASIC dialect.     I really can't imagine that no one has ever at least tried to do this.  I just can't seem to find anything.

This count? -  morphx666/vbMP3decoder: MP3 decoding library written in VB.NET
Nope. Seems to be Visual Basic form design GUI OOPS with internal libraries.
Reply
#9
why do you want to do this in a commercial language product abandoned over 30 years ago?  if you have qb64pe, why do you still need the old code?  do you have clients on ancient computers, those that couldn't even run windows 3.1?  then there would be sense to what you're requesting.  still, i don't think users of ms-dos were that eager for mp3 playback.

when i had soundblaster i was overjoyed just getting any wave playback, all five seconds of it at the highest quality of 22050hz 8-bit.  because it was a tandy computer.  when i plugged in the frecking purchased soundcard, it disabled the dac on the tandy which sucked.

if your ancient computer could run windows then it could probably be done via mci.  but likely that is a function of windowsxp.

another way is to join the "testing" for freebasic using djgpp to force a 32-bit programming system into a 16-bit operating system.  you'd be interested in faq entry #9:

https://www.freebasic.net/wiki/FaqDOS
Reply




Users browsing this thread: 1 Guest(s)