I needed a script that I could bind to keystrokes to switch audio profiles in Linux. This is pretty basic but does what I need.
I wouldn't really suggest it as a straight copy for anyone but it's good reference on how to change pulseaudio streams on the fly. This script also moves the streams to the new device so no need to restart any applications.
Use as you wish.