您需要使用第 3 方虚拟麦克风,如 this SO answer. 中所述
安装完成后,您只需将其设置为默认音频驱动程序即可。
如果您想快速且频繁地进行设置,可以将其设置为热键:
^!s::
toggle:=!toggle ;toggles up and down states.
Run, mmsys.cpl
WinWait,Sound
if toggle
ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
Else
ControlSend,SysListView321,{Down 2} ; This number selects the matching audio device in the list, change it accordingly
ControlClick,&Set Default
ControlClick,OK
return
最后,您可以创建一个 AHK 脚本,将每个键设置为使用 SoundPlay 运行音频文件。
:?:1::
SoundPlay, ./key_1.wav, 0
return
如果您想将键盘重新映射到 Monotone 钢琴,请使用 SoundBeep:
:?:1::
SoundBeep, 37 ; min frequency
return
:?:2::
SoundBeep, 137
return
:?:3::
SoundBeep, 237
return
...
:?:M::
SoundBeep, 32767 ; max frequency
return
如果您想要更快地映射更清晰的色调,那么我建议您创建自己的程序。