Jump to content

easy to switch input or output audio


Recommended Posts

11 minutes ago, chris said:

How is this different than @mikegrb's Audio Device Workflow?


I took a look, and the underlying scheme used is the same.

 

But I did something different, for example, I will prompt the currently selected audio.

 

 

At the same time, I consider supporting AirPlay device support, of course it is not yet supported.

 

Edited by Alan He
Link to post

Got it. And you're using Node and not Perl.

 

I personalized the keywords to "output" and "input" (based on my muscle memory with the previous Workflow) and adjusted the text of the notifications to be a little clearer:

 

Audio could not be switched to {var:device}

Audio switched to {var:device}

 

image.thumb.png.209b2cf3207460946d41afc5bef43343.png

 

Thanks for sharing!

Link to post

@Alan He I tweaked index.js to add some context to each option (the line `title: "Switch to " + item,`), but I'm getting an empty row as a result. Any idea why? 

 

console.log(
  JSON.stringify({
    items: audios
      .map((item) => item.replace(/(^(\n|\s)|(\n|\s)$)/g, ''))
      .map((item) => ({
        title: "Switch to " + item,
        arg: item,
        subtitle: item === currentDeviceRes ? 'selected' : ''
      }))
  })
);

 

99041732_CleanShot2020-12-06at19_38.03@2x.thumb.png.33f3dbf7ea9fa1f22b1faa106622a377.png

Link to post
21 minutes ago, chris said:

@Alan He I tweaked index.js to add some context to each option (the line `title: "Switch to " + item,`), but I'm getting an empty row as a result. Any idea why? 

 


console.log(
  JSON.stringify({
    items: audios
      .map((item) => item.replace(/(^(\n|\s)|(\n|\s)$)/g, ''))
      .map((item) => ({
        title: "Switch to " + item,
        arg: item,
        subtitle: item === currentDeviceRes ? 'selected' : ''
      }))
  })
);

 

99041732_CleanShot2020-12-06at19_38.03@2x.thumb.png.33f3dbf7ea9fa1f22b1faa106622a377.png

 

some code missing cause code bug.

 

I have update workflow, please update it.

Thank you.

 

I accepted your suggestion and revised the item's description.

 

image.png.d358d4e44bbc6d80b4584ff53b69a47a.png

 

 

Link to post
  • 1 month later...
  • 3 weeks later...
On 1/14/2021 at 8:19 PM, SJ2K said:

This workflow doesn't seem to detect AirPods as a valid output option (even though they appear in the Sound preference pane)

That's true at the time, I'm thinking about updating it, but this needs to be investigated.

Link to post
  • 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...