Search code examples
windowsautohotkeyhotkeys

Windows 10 Create Hotkey and Bind to Short Audio File


My father just got a new keyboard for his computer that is meant to look like an old typewriter keyboard. It certainly looks great, but I'd like to be able to use it to trigger the old "ding" sound a typewriter would make at the end of a line.

Ideally, I'd want a hotkey (say SHFT+CTRL+SPACE) that, when pressed, activates an short (2-3 second) audio file of that typewriter "ding" ("typewriterding.mp3", or "typewriterding.wav", what-have-you).

It seems like AutoHotkey may be the easiest to bind, but I want the sound to play without launching a media player (which I believe can be done through the command line). Is this combination possible?

Any insight appreciated.


Solution

  • This should do the job..

    #Persistent
    ^+Space::
        SoundPlay,  typewriter.wav ;  Make sure to place the audio file in the same folder as the script or provide the complete path to the audio file
        Return