RE: Beep on WIndows 11

2023-11-12 Thread Y Y via Python-list
I am curious and humble to ask: What is the purpose of a BEEP?


-Original Message-
From: Python-list  On 
Behalf Of Rob Cliffe via Python-list
Sent: Sunday, November 12, 2023 6:50 AM
To: Python 
Subject: Beep on WIndows 11

  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 ".
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
--
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Beep on WIndows 11

2023-11-12 Thread jak via Python-list

Rob Cliffe ha scritto:

  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 
".

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



HI,
I would first check the properties of the terminal, then the system
configuration relating to the system beep. It can be disabled.
You can find some tips here:


--
https://mail.python.org/mailman/listinfo/python-list


Re: Beep on WIndows 11

2023-11-12 Thread Dan Sommers via Python-list
On 2023-11-11 at 23:44:19 +,
Y Y via Python-list  wrote:

> I am curious and humble to ask: What is the purpose of a BEEP?

It's a simple way for a terminal-based program to alert (hence '\a') a
user or an operator that their attention is requested or required.

See also .
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Beep on WIndows 11

2023-11-12 Thread Chris Angelico via Python-list
On Sun, 12 Nov 2023 at 21:27, Y Y via Python-list
 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.)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Beep on WIndows 11

2023-11-12 Thread MRAB via Python-list

On 2023-11-12 11:16, Chris Angelico via Python-list wrote:

On Sun, 12 Nov 2023 at 21:27, Y Y via Python-list
 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.)


Recently, I wanted a program to beep.

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.

--
https://mail.python.org/mailman/listinfo/python-list


Re: Beep on WIndows 11

2023-11-12 Thread Chris Angelico via Python-list
On Mon, 13 Nov 2023 at 04:13, MRAB via Python-list
 wrote:
> 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.

I learned to make a computer beep using the programmable timer chip
(8254?). Send it signals on the I/O port saying "timer chip, speaker
signal, counter = N" (where N is the fundamental clock divided by the
frequency I wanted), and then "speaker, respond to timer chip". Then
you wait the right length of time, then send "speaker, stop responding
to timer chip".

Of course, I had a bug in the "wait the right length of time" part,
and my program stopped running.

My family was not amused.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list