How to switch between speakers and corded headphones? #2039
-
Hi, Firstly, WOW!! What an amazing project !! I have installed Raspbian Buster Lite Headless on a RPi3B+. I would like to add corded 'headphone' functionality to this build. I am planning on adding a usb soundcard to the PI which I can then use to connect headphones. I will probably use a 3.5mm male to female extension lead from the sound card on the pi to the case so that there is a convenient place to connect the headphones. What I want to know is how can I tell the pi to switch the output from the onboard audio to the usb sound card (or vice versa) ? Is it possible to do this automatically? Am I better off doing it with a gpio switch and if so how would this be done? Ideally I would like the audio to switch to headphones once they are connected and back again to the speakers when they are removed. I'd settle for having to use a button or switch if required. Or am I maybe better off trying to achieve the same thing with bluetooth headohones? Cheers. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, The easiest way would probably be the use of bluetooth headphones, as there is already a component to allow the switching between audiojack and bluetooth. There's only one gap on connecting when changing devices of the headphones: #1973 Hope this helps. |
Beta Was this translation helpful? Give feedback.
Hi,
have you tried these approaches? ( Don't know if it exactly fits your usecase )
#1638
#1389
#786
The easiest way would probably be the use of bluetooth headphones, as there is already a component to allow the switching between audiojack and bluetooth. There's only one gap on connecting when changing devices of the headphones: #1973
But i had tried this myself on a prototyping level and it worked well so far.
Hope this helps.