1

I’m trying to repurpose an old keyboard as a soundboard. I found this video that explains how I can get the inputs from just one keyboard (and not have them interfere with my normal work) and let them run something on my computer, using AutoHotkey. So far no issues.

I want AutoHotkey to play a sound (or execute a script written in whatever language, as long as I can execute it from the Windows Command Line). However I don’t want this program to just play it to my speakers, I want it to play via my microphone, so for instance friends can here it as well.

I’ve seen some solutions where all the sound from your speakers is sent to your microphone, however this is not what I want. I want them to be able to hear me, when I’m not playing sounds, and I also don’t want them to hear everything happening on my computer; just the sounds from my soundboard.

K. Looijmans
  • 113
  • 1
  • 9

1 Answers1

1

You will need to use a 3rd party virtual microphone as explained in this SO answer.

After you have that installed all you would have to do is set it as your default audio driver. If you want to set this quickly and often you can set it to a Hotkey:

^!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

Finally you can create an AHK script which sets each key to a run an audio file using SoundPlay.

:?:1::
  SoundPlay, ./key_1.wav, 0
return

If you want to remap your keyboard to a Monotone piano use SoundBeep:

:?:1::
  SoundBeep, 37 ; min frequency
return
:?:2::
  SoundBeep, 137
return
:?:3::
  SoundBeep, 237
return

...

:?:M::
  SoundBeep, 32767 ; max frequency
return

If you want clearer tones mapped faster then I would recommend to instead create your own program.

nelsontruran
  • 514
  • 4
  • 18
  • It works great, except for one thing: to use VC, I have to set my play back device to "CABLE Input". How would I have a setup that also automatically changes that back and forth? – K. Looijmans Feb 17 '18 at 23:05
  • The first bit of code lets you select your default audio playback device. The {Down 1} is how many times to press the down key in the Default sound device menu. So one of those should be to set it to the CABLE Input by number down in the list, and the other one should be your default audio. – nelsontruran Mar 01 '18 at 19:53