QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: hanness on January 07, 2021, 10:14:49 am
-
A lot of discussion about version 1.5 lately, so I thought I would just check back to see if it's possible to fix this previously reported bug in time for the 1.5 release:
https://www.qb64.org/forum/index.php?topic=1661.msg108916#msg108916
-
Hi, hanness. Sound generation with QB64 is delegated to OpenAL, an external library.
All QB64 really does is pass your parameters and it generates a sound buffer, so I must assume the technical explanation RhoSigma offered in the original post has to be taken seriously as the reason to the effect you're experiencing.
Also, notice that using SOUND/PLAY is still supported, due to retrocompatibility with QBasic/QuickBASIC, but in this day and age you'd probably be better off by using wav, ogg or mp3 files recorded with the desired frequencies, so you can easily load them with _SNDOPEN and play them with _SNDPLAY/_SNDPLAYCOPY. There are several online utilities that will allow you to generate files with the desired frequency, like https://www.wavtones.com/functiongenerator.php
-
Thanks for that. I had already ruled that explanation out because looking at the frequency output with a meter verified that is was actually really a problem, not merely a perceived one.
Also, using recorded audio won't work in my application because I need highly accurate tones lasting 200mS, 500mS, 800mS, and 1S with seemless transitions from one to the next.
Thankfully, I have an alternative method for doing this now.
Thanks again for the response.