for a while, I have been using hardware through Linux that uses the beep from the PC speaker. I’m actually really used to it, so when I switched to using hardware with an unusably loud (volume can’t be changed) volume (and also different frequency), I started looking into “exporting” the original beep to an audio file that could be played at different volumes and for other purposes.
looking through the internet, however, I haven’t found any attempts to represent any actual PC speaker beep in an audio file, so I’m asking you guys if you know how to do so. presumably, the beep is just a short, simple waveform at a certain frequency, but I am not sure what that waveform is, or what the easiest way to do so is.
thanks. do you know any software that could do play the PC speaker while reducing amplitude, or possibly existing code examples to create this myself? I know of libraries that can beep at different frequencies and lengths, but not with different volumes.
After a quick search engine visit looking for “pwm pc speaker linux”, the couple first results seem promising (I didn’t test them, however):
https://github.com/xdsopl/pcspkr
https://unix.stackexchange.com/questions/353558/playing-arbitrary-pcm-sound-throught-the-pc-speaker