Even though it should be obsolete thanks to PCMSTREAM, It seems that few people are buying the DLC, so I decided to update the WAV BGM player again.
Instructions:
Playing WAV Files
Put
LOAD "PRG1:WAVBGM.LIB",0:USE 1
at the start of your code to load the WAV player library.
Then use
WAVBGM file$,rate,loop,autoplay
To play a WAV.
file$ is the WAV file "DAT:EXAMPLE.WAV"
rate is the sample rate: 3=8180, 4=16360, 5=32720
loop sets whether the BGM will loop. 1=loop, 0=play once
autoplay sets whether it will play immediately after the command. 1=play, 0=BGMSET 128 only.
Sending WAV Files
To transfer WAV files, I suggest WAV2SBWAV by Perska.
https://smilebasicsource.com/page?pid=339
WAIT!!! Don't leave yet! When preparing your audio file, you can use the following sample rates/lengths:
sample rate --- maximum length
8180Hz --- ~60 seconds (524288 samples)
16360Hz --- ~30 seconds (524288 samples)
32720Hz --- ~15 seconds (524288 samples)
If you want your audio file to loop, you
MUST have an exact multiple of
16384 samples! (you might need to change the speed of the song a little bit, in order to make it fit)
MAKE SURE YOU CHECK "ignore sample count" in WAV2SBWAV
Notes:
I still recommend buying it though.