I tried to make the script fetch the microphone name by running pactl info and parsing the output. I am unfortunately unable to test this on a system other than mine, but ideally this would have some error-handling logic in case for some reason this fails to get the correct mic name.
If this seems like a good idea, I'd be glad to contribute to it further!