daveyman123
Posts: 115
Joined: Fri Dec 12, 2014 2:21 am

Bluetooth Audio

Sun Jan 01, 2017 4:45 pm

hello,

Is it possible to switch audio output to a bluetooth speaker via a script or command line?

Thanks,
DM123

youness
Posts: 34
Joined: Sat Sep 03, 2016 4:51 pm
Contact: Website

Re: Bluetooth Audio

Wed Jan 04, 2017 4:10 pm

Yes you can, using pacmd (pulseaudio command):

pacmd set-default-sink bluez_sink.xx_xx_xx_xx_xx_xx

replace xx_xx... by the MAC of your speaker.

More details here: http://youness.net/raspberry-pi/bluetoo ... spberry-pi

daveyman123
Posts: 115
Joined: Fri Dec 12, 2014 2:21 am

Re: Bluetooth Audio

Sat Jan 07, 2017 4:07 am

youness wrote:Yes you can, using pacmd (pulseaudio command):

pacmd set-default-sink bluez_sink.xx_xx_xx_xx_xx_xx

replace xx_xx... by the MAC of your speaker.

More details here: http://youness.net/raspberry-pi/bluetoo ... spberry-pi
Thank you Youness. this was definitely what I was looking for.
bluezctl allows me to connect and then pacmd allows me to connect pulseaudio and then sound just plays!

Now I can start on my project to connect to the Pi via python and set up syncing via a python script.


Thanks again,
DM123

Return to “General discussion”