Change audio input and output devices from terminal

I'd like to be able to change my audio inputs / outputs from the command line so that I can script my studio setup. Is it possible to change the selected audio input / output in MacOS from the command line? Previously, someone on StackExchange posted a clever AppleScript to do this. However, I'm specifically looking for a way to do this with a terminal command.

Change audio input and output devices from terminal

I'd like to be able to change my audio inputs / outputs from the command line so that I can script my studio setup.

Is it possible to change the selected audio input / output in MacOS from the command line?

Previously, someone on StackExchange posted a clever AppleScript to do this. However, I'm specifically looking for a way to do this with a terminal command.