Accessing the settings of OS via swift?

Good afternoon everyone I'm trying to build a custom program and widget

It ideally would be a simple toggle that changes my default mic input setting to the default Macbook Pro mic.

What direction should I go in to learn how to access the OS and change settings via an app in this way? Specifically accessing the OS and deploying a custom app to my machine.

Thanks for reading

Accessing the settings of OS via swift?
 
 
Q