The script can be extended with additional features like:
- fixing macOS balance bug (outputDevice:setBalance(0.5) on output device change)
- muting built-in speakers on headphones disconnect event
- pausing Spotify when external headphones are disconnected