Send mp3 metadata to car via bluetooth
Moderator: Martin
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Send mp3 metadata to car via bluetooth
Hello,
The mp3 is playing in my own Automagic flow.
I can get the track name and artist from the mp3 file.
I currently announce it in a pop-up notification on my phone and via speech output.
Is there a way of sending it to the car's head unit when connected via bluetooth?
Many thanks
Micky
The mp3 is playing in my own Automagic flow.
I can get the track name and artist from the mp3 file.
I currently announce it in a pop-up notification on my phone and via speech output.
Is there a way of sending it to the car's head unit when connected via bluetooth?
Many thanks
Micky
Crude but it works.
Re: Send mp3 metadata to car via bluetooth
At the speech output, if you choose Audio Stream Type - Music, it should be sending the audio output to the bluetooth device when connected. Or you can try stream - Alarm, it should be sending to both, speaker and bluetooth device.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Send mp3 metadata to car via bluetooth
I think you mean to send the metadata of the song playing. I can't test it right now, but I found out that action Send Broadcast can help you.
As it's said in a Stack Overflow thread (Link), it seems you can send a broadcast with metadata changed using (I believe would be) in the Action field, com.android.music.metachanged, and then Extras, something like this:
And you should be able to also add in that format, other data as mentioned in the linked thread, like duration of the song. Again, I couldn't test it yet. If I get to do so I'll post back what I got, if I even get that working.
As it's said in a Stack Overflow thread (Link), it seems you can send a broadcast with metadata changed using (I believe would be) in the Action field, com.android.music.metachanged, and then Extras, something like this:
Code: Select all
putString("artist", artistName);
putString("album", albumName);
putString("track", trackName);
Re: Send mp3 metadata to car via bluetooth
I wonder if this could be used to display other alternative data to the car's head unit?
I could see a use case where music metadata is normally displayed by an app like Spotify, but it is temporarily overwritten by other information when, say, a message is received...
I could see a use case where music metadata is normally displayed by an app like Spotify, but it is temporarily overwritten by other information when, say, a message is received...
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: Send mp3 metadata to car via bluetooth
Desmanto, you misunderstood me.
Ariloc, you understood me, but that doesn't work.
Wibbly, nice idea. I'm guessing that it's possible.
Thanks everyone for your help.
Ariloc, you understood me, but that doesn't work.
Wibbly, nice idea. I'm guessing that it's possible.
Thanks everyone for your help.
Crude but it works.
Re: Send mp3 metadata to car via bluetooth
I'm sorry it doesn't work, but I don't have a device at the moment that supports displaying metadata through Bluetooth. About @Wibbly's idea, it's totally possible. There is an app called Botifier that used to be able to display the notifications from the phone in the car stereo screen, but it's been years since it was last updated and couldn't test it, and also isn't in the Play Store so you have to download it from xda-developers if you want to check if it still works (Botifier). In the Stack Overflow thread I linked before there's another method described in the 2nd comment, but you need to look into using Java with Automagic.
Again, if I get to figure out something, I'll post it as soon as I can.
Again, if I get to figure out something, I'll post it as soon as I can.
Re: Send mp3 metadata to car via bluetooth
Sorry, I don't have car yet. Is this head unit running android and can install Automagic? Or it is just like a notification mirroring, maybe like WearOS but can't have any automagic companion on it?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: Send mp3 metadata to car via bluetooth
I think it's got Android Auto, but I never bothered with it.
All I'm trying to do is send the track name & artist to the car's head unit.
It's possible because YouTube etc does it.
Not so important now because I deleted my music when I did a factory reset. I also lost all my global variables.
Happy days!
All I'm trying to do is send the track name & artist to the car's head unit.
It's possible because YouTube etc does it.
Not so important now because I deleted my music when I did a factory reset. I also lost all my global variables.
Happy days!
Crude but it works.
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: Send mp3 metadata to car via bluetooth
Hi,
Just use the action - Init Variables Media Metadata
It supplies variables for everything stored in the mp3 if available.
Hope this helps
Micky
Just use the action - Init Variables Media Metadata
It supplies variables for everything stored in the mp3 if available.
Hope this helps
Micky
Crude but it works.
Re: Send mp3 metadata to car via bluetooth
Wrong way round I think? That pulls the metadata from an MP3, I want to overwite the metadata the car's head unit is seeing in the MP3 (temorarily)Micky Micky wrote: ↑18 Mar 2020 18:07Hi,
Just use the action - Init Variables Media Metadata
It supplies variables for everything stored in the mp3 if available.
Hope this helps
Micky