Jump to content

Audio Switcher (Swiftly switch audio output and input devices)


Recommended Posts

Hi folks, I built something today using Alfreds new Workflow Builder. Maybe you find it useful.

 

Why this Workflow?

I find myself frequently switching between audio output and input devices. Existing solutions either are slow, take to many interactions or need third-party tools.

Therefore, this workflow offers a couple of features to make switching audio devices easier and faster.

 

It also allows filtering out devices you do not want to see in the suggestions.

image.png.412a3b39826011d378d124ec0f4b432c.png

 

In order to make it even faster, the workflow provides Hotkeys and Remote Triggers for up to three input and up to three output devices and comes with its own Remote page.

image.thumb.png.f9ec5ef7472e369bb1636ca6b7432c1a.png

 

The workflow is of course configurable. 😁

image.thumb.png.b1646300cda86fdd4c6be7559b8bde86.png

 

 

Some technical goodies:

This workflow does not need any third-party tools such as `SwitchAudioSource` or `jq`. It relies fully on Swift and ZSH, which should both be available in modern OS X Versions. Furthermore, as it does not contain binaries, code signing isn't an issue.

 

 

Inspired by:

 

I am looking forward for your thoughts and feedback! 🙏

Edited by TobiasMende
Link to comment
  • 1 month later...

Really eager to use this workflow as I switch audio sources often.

 

Just installed this with the latest MacOS on an M1 MacBook Pro, but it does not show up.  Thanks for any help.

I get this in the bug report:

 

Quote

[08:23:56.729] Logging Started...
[08:24:00.372] Audio Switcher[Script Filter] Queuing argument '(null)'
[08:24:00.499] Audio Switcher[Script Filter] Script with argv '(null)' finished
[08:24:00.508] ERROR: Audio Switcher[Script Filter] Code 1: <unknown>:0: error: unable to load standard library for target 'arm64-apple-macosx14.0'
[08:24:18.015] Audio Switcher[Script Filter] Queuing argument '(null)'
[08:24:18.244] Audio Switcher[Script Filter] Script with argv '(null)' finished
[08:24:18.251] ERROR: Audio Switcher[Script Filter] Code 1: <unknown>:0: error: unable to load standard library for target 'arm64-apple-macosx14.0'

 

Link to comment

@TobiasMende This is fantastic, and almost exactly what I have been looking for. One thing that would make it absolutely perfect for me would be if there were an option to toggle among favorites with a single hotkey. For example: I most often want to just switch between just my headphones and display speakers, so I had set up (using a Keyboard Maestro macro) so that one button would switch just between those two: if I am currently set to headphones, it switches to the display speakers and vice versa.

 

Do you think that is something you might be able to add?

Link to comment
12 hours ago, JAShapiro said:

@TobiasMende This is fantastic, and almost exactly what I have been looking for. One thing that would make it absolutely perfect for me would be if there were an option to toggle among favorites with a single hotkey. For example: I most often want to just switch between just my headphones and display speakers, so I had set up (using a Keyboard Maestro macro) so that one button would switch just between those two: if I am currently set to headphones, it switches to the display speakers and vice versa.

 

Do you think that is something you might be able to add?

Thank you for this idea! I like the idea of being able to quickly toggle between two devices. 
I will check your PR and get back on GitHub 🙂

Link to comment
On 2/6/2024 at 8:26 AM, milopus said:

Really eager to use this workflow as I switch audio sources often.

 

Just installed this with the latest MacOS on an M1 MacBook Pro, but it does not show up.  Thanks for any help.

I get this in the bug report:

 

 

Sorry for the delayed response.
This sounds like your Mac has problems executing the Swift script.

Have you installed the Workflow from the Gallery (https://alfred.app/workflows/tobiasmende/audio-switcher/) or from the forum?

I thought the requirements are pre-installed in the modern Mac versions, but maybe some requirement is missing. This might be solved by running `xcode-select --install` on the command line.

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...