I need a python way to beep the system/motherboard speaker independent of the speakers attached to my computer. I don't always have the speakers turned on, so i need to beep the motherboard speaker.
All the libraries i've seen (winsound especially), just play a sound through the speakers attached to my computer. I'd like to beep the system/motherboard speaker.
Is there a way to beep the system speaker? I'm okay with Windows dependent libraries.
just print '\a'
to stdout
print '\a' # for python3, print('\a')
if you don't want a newline be printed
print '\a\b', # for python3. print('\a\b', end='')
sys.stdout.flush()
Use a call to the command line:
>>> from subprocess import call
>>> call(["echo", u'\x07'])
As $ echo ^G
- ^G
is the character for motherboard beep - will produce that sound, to do it with python you only have to execute the comand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With