Alan He 17 Posted December 6, 2020 Share Posted December 6, 2020 (edited) ## Feat 1. switch audio 2. show current selected audio download link: https://github.com/alanhg/alfred-workflows/tree/master/switch-audio Edited December 7, 2020 by Alan He update snapshot antkn33 and Chris Messina 2 Link to post
Chris Messina 33 Posted December 7, 2020 Share Posted December 7, 2020 How is this different than @mikegrb's Audio Device Workflow? Link to post
Alan He 17 Posted December 7, 2020 Author Share Posted December 7, 2020 (edited) 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 December 7, 2020 by Alan He Link to post
Chris Messina 33 Posted December 7, 2020 Share Posted December 7, 2020 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} Thanks for sharing! Link to post
Chris Messina 33 Posted December 7, 2020 Share Posted December 7, 2020 @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' : '' })) }) ); Link to post
Alan He 17 Posted December 7, 2020 Author Share Posted December 7, 2020 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' : '' })) }) ); 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. Chris Messina 1 Link to post
Alan He 17 Posted December 7, 2020 Author Share Posted December 7, 2020 I am considering supporting airplay devices, which not supported currently. Chris Messina 1 Link to post
Chris Messina 33 Posted December 7, 2020 Share Posted December 7, 2020 @Alan He Just spotted this workflow, might be of interest: https://github.com/Acidham/alfred-airpod-connector Link to post
SJ2K 3 Posted January 14 Share Posted January 14 This workflow doesn't seem to detect AirPods as a valid output option (even though they appear in the Sound preference pane) Alan He 1 Link to post
Alan He 17 Posted February 3 Author Share Posted February 3 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
Alan He 17 Posted February 12 Author Share Posted February 12 (edited) @SJ2K I have updated the workflow. and it support AirPlay https://github.com/alanhg/alfred-workflows/tree/master/switch-audio Edited February 12 by Alan He Chris Messina 1 Link to post
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now