.NET - on Windows, at least - supports “beeping” the system speaker from PowerShell by calling [Console]::Beep()
or [Console]::Beep([int32]$frequencyHz,[int32]$durationMS)
. In the latter case, the call clearly supports only integral Hz values - but real notes aren’t so nice and integral. What I am looking for would be something that provides a similar interface to beeping the system speaker, but allows the frequency to be a non-integer. Ideally, this would be available for all platforms on which PowerShell runs, but I’ll accept Windows-only. Free (both price and Open Source) preferred; low one-time cost acceptable.
-
I’m voting to close this question because independent research has rendered the question unanswerable as asked.– Jeff ZeitlinCommented Apr 5, 2021 at 11:47
1 Answer
Some additional research seems to indicate that this has always been an issue, even pre-.NET - the original BASICA/GWBASIC SOUND statement also only took values in the range 32 to 32767, and some testing at the low end of the range indicates that rounding/truncation to integer occurred. I thus assume that this is a limitation of the firmware (not the speaker itself, but the supporting electronics), and that if I want accurate sound, I will have to resort to generating MIDI or WAV/MP3/etc. files and playing them.