Apologies if this is not a Python question.
I recently moved from a WIndows 10 laptop to a Windows 11 one.
Although there is nothing wrong with the sound on the new machine (I can listen to podcasts and watch videos), I find that outputting "\a" to the console (aka stdout) no longer beeps (or makes any sound). This is true whether I print "\a" from a python program, or "type <a-file-containing-a-bell-character>".
I have found via Google workarounds such as
os.system("rundll32 user32.dll,MessageBeep")
but it is a trifle annoying to have to modify all of my programs that beep. Can anyone shed light on this, and perhaps give a simpler fix?
Best wishes
Rob Cliffe
I am curious and humble to ask: What is the purpose of a BEEP?
I am curious and humble to ask: What is the purpose of a BEEP?
On Sun, 12 Nov 2023 at 21:27, Y Y via Python-list
<python-list@python.org> wrote:
I am curious and humble to ask: What is the purpose of a BEEP?
There are several purposes. I can't say which of these are relevant to
the OP, but some or all of them could easily be.
* A very very simple notification that can be triggered by any program
* An audio cue that is not routed to your regular audio system (good
if you use headphones but are AFK)
* An extremely low level signal that requires little-to-no processing power
* An emergency signal that does not even require a CPU (probably not
in this instance though!)
* Imitating a pre-existing audio signal that works by beeping
Depending on what's needed, a more complex system might suffice (for
example, I cover the first two points by having an entire separate
audio subsystem with its own dedicated speakers, which I can invoke
using VLC in a specific configuration); but a basic beep is definitely
of value. I suspect in this situation that the first point is
important here, but it's up to the OP to elaborate.
(Note that the "no CPU emergency sound" option usually requires a motherboard-mounted speaker or speaker header, which not all have
these days. Sad.)
In the old days, with a BBC micro, that was simple. It had 3 tone
channels and 1 white noise channel, with control over frequency,
duration and volume, beeps on different channels could be synchronised
to start at the same time, there was a sound queue so that the SOUND
command returned immediately, and there was an ENVELOPE command for controlling the attack, decay, sustain and release. All this on an 8-bit machine!
My current PC is way more powerful. 64-bit processor, GBs of RAM, etc.
Python offers winsound.Beep. 1 tone, no volume control, and it blocks
while beeping.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 46:38:06 |
Calls: | 10,395 |
Calls today: | 3 |
Files: | 14,066 |
Messages: | 6,417,273 |
Posted today: | 1 |