I found this post on the forum suggesting using BASS.dll file to record audio with AutoHotkey. I wasn’t overly happy with the way the script worked (especially deciding if you’re using 32-bit AutoHotkey or 64 bit version. So I made some updates to it and recorded a video to document it. If you just want the RunWith function, you can click here. Otherwise, you can grab all the scripts and dll in the following download
I tested recording in .mp3 , .wav, .ogg, and .aiff file formats.
How to Record audio with BASS.dll and AutoHotkey