Can I have Win 10 make a native beep?

Page 1 of 2 12 LastLast

  1. Posts : 31
    W10 Pro °2022/4
       #1

    Can I have Win 10 make a native beep?


    In Win 7 I used to use a beep after some Photoshop actions by calling a .bat file, and going by the info, "To make a short beep: echo BEL or beep BEL (typed by Alt + 007)"

    I used the beep command.

    At first "sight," this doesn't seem to work in Win 10.

    Is there a native alternative? (w/o opening media players)

    UPDATE: I advise to use this as a Photoshop script instead...
    Code:
    app.beep();
    Last edited by Robben; 07 Aug 2022 at 17:25.
      My Computer


  2. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #2

    Hi -

    Are there sound settings in Photoshop that can be configured for certain key actions?

      My Computer


  3. Posts : 31,644
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #3

    Robben said:
    In Win 7 I used to use a beep after some Photoshop actions by calling a .bat file, and going by the info, "To make a short beep: echo BEL or beep BEL (typed by Alt + 007)"

    I used the beep command.

    At first "sight," this doesn't seem to work in Win 10.....
    BEEP isn't a valid command in a Windows 10 command prompt, but ECHO is.

    Can I have Win 10 make a native beep?-image.png

    Even if you use the echo command the reason it doesn't appear to work is that in a Windows 10 command prompt the Alt + 007 BEL character doesn't make a beep, it plays the default system sound. This takes a few seconds to play, but the .bat file command window closes before the sound gets a chance to be heard.

    To hear the sound you need to add a second line to the .bat file that will wait for two seconds and give the sound time to play:

    timeout /T 2

    An added complication is that you can't actually type the BEL character into Notepad, so you have to create the .bat file by echoing text to it from the command line. You can type BEL in a command prompt with Ctrl+G.

    Can I have Win 10 make a native beep?-image.png

    Here's the one I made above, attached as a .zip file. After you have un-zipped it you will have to unblock the .bat file before you can run it. All files you download from sites like Ten Forums are marked as 'blocked' by default.

    Unblock File in Windows 10

    By all means open it in Notepad to look at it, but do NOT then save it - that may remove the BEL chaaracter!
    Can I have Win 10 make a native beep? Attached Files
    Last edited by Bree; 26 Apr 2022 at 23:15.
      My Computers


  4. Posts : 31
    W10 Pro °2022/4
    Thread Starter
       #4

    Compumind said:
    Are there sound settings in Photoshop that can be configured for certain key actions?
    I wouldn't use this system if I knew there were... You can have a dialog pop up, but that just gets in the way. I'm now wondering if you can make an error on purpose to get a ding, but Bree's file is doing the job.

    I only use it for a "quick save" action macro. As I sometimes don't press my key well enough, I want to be sure I saved the file. Ironically, the beep wasn't always there, IIRC, but this is now explained and solved by Bree.

    To make the beep, I make a script.jsx like this one, and record opening of the script into my PS action.

    Code:
    var sound = new File("/c/Win 10 beep.bat");  // Bree's file
    sound.execute();
    Bree said:
    BEEP isn't a valid command in a Windows 10 command prompt, but ECHO is.
    I managed to put the BEL into a .bat before and it worked in Win 7, but not 100% of the time. Thanks for clearing up why!

    My ideal is to have a short blip (for cases where I do fast quick saves), but this sound will do in most cases. I guess at worst I could change that sound file or assign a "blip" sound (I could make) in Windows.

    you will have to unblock the .bat file
    That wasn't the case — maybe because I use Total Commander. But it's a welcome warning for me, as much Win 10 peculiarities are still new to me.
      My Computer


  5. Posts : 1,764
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #5

    Perhaps try AutoHotkey - either the SoundBeep or SoundPlay commands.

    You don't even need to install AutoHotkey... just call the AutoHotkey.exe interpreter from a BAT file with an AHK script file as an argument.

    Hope this helps...
      My Computer


  6. Posts : 31
    W10 Pro °2022/4
    Thread Starter
       #6

    RickC said:
    Perhaps try AutoHotkey [...]
    I do use AutoIt sometimes in an action for other stuff.
      My Computer


  7. Posts : 16,946
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #7

    Alternatively, you could call a PS script to speak whatever message you wanted.
    - It takes a couple of seconds to run

    SpeechTest.ps1
    Code:
    Add-Type -AssemblyName System.speech
    $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
    $speak.Speak('Ten Forums') | Out-Null
    or

    Code:
    Add-Type -AssemblyName System.speech
     $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
     $speak.Speak('Beep') | Out-Null



    I call variants of this from many of my scripts to announce completion / errors / … .

    Denis
    Last edited by Try3; 27 Apr 2022 at 07:28.
      My Computer


  8. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #8

    @Robben -

    Now I understand the reason behind it.
    Thanks @Bree for assisting.

      My Computer


  9. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #9

    Hello Denis,

    I usually use something like this if ever I need to insert speech into a Batch Script . . .

    Code:
    
    PowerShell Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('Hello Ten Forums')"
    
      My Computer


  10. Posts : 31
    W10 Pro °2022/4
    Thread Starter
       #10

    Try3 said:
    Alternatively, you could call a PS script to speak whatever message you wanted.
    - It takes a couple of seconds to run
    Cool! But for my particular purpose it takes too long.

    BTW, to not have the Command Prompt window shown, I'm calling the .bat from this .vbs script (cos it doesn't work with a shortcut to the bat, set to "minimized") ...

    call bat.vbs (called by the .jsx)
    Code:
    Set WshShell = CreateObject("WScript.Shell") 
    WshShell.Run chr(34) & "C:\Win 10 beep.bat" & Chr(34), 0
    Set WshShell = Nothing
    from How to run .BAT files invisibly
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:17.
Find Us




Windows 10 Forums