Playing Audio Through Bluetooth Speakers
Setup via Desktop Environment
If your hardware has a monitor, keyboard, and mouse connected, you can easily output sound to Bluetooth speakers through the desktop environment. The setup method may vary slightly depending on the Linux distribution; this guide uses Raspberry Pi OS as a reference.
Click the Bluetooth icon in the top panel and select [Add Device].

Select the discovered Bluetooth speaker and click [Pair] to connect.

Once the connection is complete, a success message will be displayed.

Right-click the speaker icon in the top panel and change the sound output to the Bluetooth speaker. All subsequent audio will be output through the Bluetooth speaker.

Remote Setup via SSH
If your hardware doesn’t have a monitor, keyboard, and mouse connected, you can configure it remotely via SSH.
Enter the following command in the terminal:
bluetoothctl
Enter the following commands in sequence to scan for Bluetooth devices:
power on
agent on
default-agent
scan on
Pair with the discovered Bluetooth speaker using its MAC address:
pair <Bluetooth device MAC Address>
Example: pair FC:58:FA:71:88:2C
Connect to the Bluetooth device:
connect <Bluetooth device MAC Address>
Example: connect FC:58:FA:71:88:2C
Exit bluetoothctl:
exit
Enter the following command to display available sound output devices:
pactl list short sinks
Copy the “bluez_sink.XX_XX_XX_XX_XX_XX.a2dp_sink” portion from the displayed output and use the following command to set it as the default sound output device:
pactl set-default-sink <copied sink name>
Example: pactl set-default-sink bluez_sink.FC_58_FA_71_88_2C.a2dp_sink
To adjust the volume, use the following command (example: setting volume to 50%):
pactl set-sink-volume <copied sink name> 50%
Example: pactl set-sink-volume bluez_sink.FC_58_FA_71_88_2C.a2dp_sink 50%