The most recent Raspberry Pi 3 and up come with integrated bluetooth. Which is nice. It lowers the cost and power usage and allows you to connect in and out of the Pi via any bluetooth device.
But for the specific instance where you simply want to broadcast sound to an external speaker there are a couple of ways to do it.
If you are running Raspbian (which is what comes standard) then you can likely use integrated bluetooth connection via a variety of sound management apps. But what if you are using your Pi from the Command Line or via a program? How do you manage bluetooth?
I’m not going to fully recap the first method I found which includes the use of the bluetoothctl program which you can run from the command line. Basically in that instance you’d just be running some scanning and pairing commands while you open pairing on the nearby speaker. It might work. I found it frustrating. The issue is that you’re likely going to have some volume management issues unless you get into additional sound configurations which can be reset with HDMI inputs and other scenarios.
None of this would work for our BiBli users so we added a simple bluetooth management tool as part of BiBli OS 2.0.
It allows you to connect your Pi or swarm of Pis to any nearby headset or speakers.
(Note: Order an SD card here and get the rest of the BiBli OS to play with at the same time.)