How to build a QT bluethooth music player
-
Hello,
what i want to create a bluethooth speaker with QT (on a RaspberryPi).
So I want to connect my phone via Bluethooth to the RaspberryPi and the QT programm should show me the song titel, how long the song takes, a button to skip the song, change volume and so on.I am allready able to connect the phone with the QT programm and the music is also playing over the speaker of the RaspberryPi but how I am able to access the music metadata to show the song titel? And how can I tell the phone to pause the song and so on?
I hope you guys can help me.
Best regards,
Leon -
@ElPadre
how did you exactly implement the audio playback connection? I dont find any reference in the docs.
Basically for audio playback the A2DP (Advanced Audio Distribution Profile) profile is used. And the AVRCP (Audio/Video Remote Control Profile) profile for audio meta data and playback control.Since you are on a RPi you might also want to bypass QtBluetooth module completely and use KDE BluezQt (especially the MediaPlayer class)
-
@raven-worx
I just started the QT Bluetooth example "Bluetooth Scanner". And after I paired my phone with the raspi the audio was playing over the speakers.Oh wow yes this lib looks promising.
Do you know any example project which is using the BluezQT lib with the MediaPlayer Class? -
@ElPadre
no i dont couldnt find an example, but i think you can follow the mediaendpointconnector test implementation:
https://github.com/KDE/bluez-qt/edit/master/tests/mediaendpointconnector.cpp