# Smart audio output switching

Use a wrapper around [DWeller's amazing switchaudiosource](https://github.com/deweller/switchaudio-osx), to use partial matching to switch to an audio source by typing part of it's name: `out Speak` switches to _Macbook Pro Speakers_.

I use the following script

```shell
#!/usr/bin/env bash
# Usage: ./out Speak
if [ "$#" -ne 1 ]; then
  switchaudiosource -a
  exit 1
fi

switchaudiosource -a | grep "$1" | xargs -I _ switchaudiosource -s "_"
```