• Beep on WIndows 11

    From Rob Cliffe@21:1/5 to All on Sat Nov 11 22:49:51 2023
     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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jak@21:1/5 to All on Sun Nov 12 02:50:26 2023
    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 <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


    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://superuser.com/questions/10575/turning-off-the-cmd-window-beep-sound>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Y Y@21:1/5 to All on Sat Nov 11 23:44:19 2023
    SSBhbSBjdXJpb3VzIGFuZCBodW1ibGUgdG8gYXNrOiBXaGF0IGlzIHRoZSBwdXJwb3NlIG9mIGEg QkVFUD8NCg0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogUHl0aG9uLWxpc3Qg PHB5dGhvbi1saXN0LWJvdW5jZXMrbWlja2V5X3lhbmc5PW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lnaHQgb24gdGhpcywgYW5kIHBlcmhhcHMgZ2l2ZSBh IHNpbXBsZXIgZml4Pw0KQmVzdCB3aXNoZXMNClJvYiBDbGlmZmUNCi0tDQpodHRwczovL21haWwu cHl0aG9uLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3B5dGhvbi1saXN0DQo=

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to python-list@python.org on Sun Nov 12 22:16:40 2023
    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.)

    ChrisA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From 2QdxY4RzWzUUiLuE@potatochowder.com@21:1/5 to Y Y via Python-list on Sun Nov 12 05:50:00 2023
    On 2023-11-11 at 23:44:19 +0000,
    Y Y via Python-list <python-list@python.org> 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://en.wikipedia.org/wiki/Bell_character>.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From MRAB@21:1/5 to Chris Angelico via Python-list on Sun Nov 12 17:12:17 2023
    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
    <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.)

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to python-list@python.org on Mon Nov 13 04:21:19 2023
    On Mon, 13 Nov 2023 at 04:13, MRAB via Python-list
    <python-list@python.org> 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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)