Reputation:
I have just connected my Raspberry Pi (running Raspbian) with bluetooth speakers (Creative D80) and they working "quite" fine.
The only issue I have is whenever I play a sound using mpg321 through a Python command, it takes a while to actually start playing something (time the Raspbian takes to establish a connection to the device).
Here you can see my code:
from os import system
def play(file):
statement = 'sudo -u pi mpg321 -g 5 -q -a bluetooth sound/' + file
system(statement)
Is there a way to force Raspbian to keep the connection alive all the time?
Upvotes: 1
Views: 2112
Reputation:
sudo apt-get install bluez-tools
sudo nano /etc/rc.local
bt-audio -c MAC ID
sudo reboot
Upvotes: 1