[GUIDE][Difficulty: Beginner] Read Aloud Track Name and Artist

Search This thread

MishaalRahman

Editor in Chief
Nov 2, 2015
1,038
2,118
www.xda-developers.com
Do you have a bunch of new songs that you listen to while in the car, and would like to learn to associate the song with its track name and artist? Rather than looking at your car's display or your music widget, you can simply have Tasker them aloud when a song starts.

Prerequisites

  • A compatible music player. Go to this page and search for %MTRACK to see more details.


Instructions

  1. Create a new profile and name it "Say Track."
  2. Create an Event context, go to Variables --> Variable Set. Set the variable to %MTRACK and leave the value blank.
  3. Create the task but don't name it anything.
bysCepu.jpg


  1. Task --> Wait. Wait 1 second. This is necessary because %MARTIST sometimes takes a bit more time to be set after %MTRACK is.
  2. Variables --> Variable Split. Name %MARTIST, Splitter is - (a dash).
  3. Alert --> Say. Text: %MTRACK by %MARTIST1. Check If and set it to if %MPLAYSTATE !~ PAUSED AND %SCREEN ~ off. This is so it'll only read the track name and artist if the music isn't paused and if the screen is off.
  4. Alert --> Flash. Text: %MTRACK by %MARTIST1. Check If and set it to if %MPLAYSTATE !~ PAUSED AND %SCREEN ~ on. This will flash the track name and artist if the screen is on and music is playing (obviously).
XLkVsZY.jpg


That's it! Let me know if you find this one useful. Also, post below if it works for your music player. I use Gonemad Music Player and it works great for me!

I've attached the XML file below. To import it, move it to /sdcard/Tasker/Profiles, then open Tasker and long-press on the Profiles tab up top and click on Import.
 

Attachments

  • Say_Track.prf.xml
    1.9 KB · Views: 1,481
Last edited:

teorouge

Senior Member
Jul 29, 2008
2,599
293
39
Trento
Thanks, but how can you handle different languages? I mean, you can't listen to English/Japanese/whatever songs/groups/artists in your main language (that's Italian, in my case) as you wouldn't even understand a thing. I tried to implement this long ago for car use via bluetooth and screen off but in the end I had to give up: could you find a solution maybe?
 
  • Like
Reactions: Zhiro90

o0adam0o

Senior Member
Apr 6, 2007
805
72
I just cant get this to work. All it does is literally say "%MTRACK" and "%MARTIST" .. it doesnt give the song info.

Im on 6.0 .. any help?
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
@MishaalRahman Are you sure that the variable "%MARTIST" is a tasker monitored Variable? It seems, that it's not a built-in variable, as I checked on this page. Additionally it doesn't work on my phone (%MTRACK is working fine though).

EDIT: And I can't import the project (it doesn't get recognized by tasker)
 
Last edited:

MishaalRahman

Editor in Chief
Nov 2, 2015
1,038
2,118
www.xda-developers.com
I too would like to know this information.

Spotify won't work with this, but you can intercept the notification using AutoNotification or NotificationListener and have it read from there.

I just cant get this to work. All it does is literally say "%MTRACK" and "%MARTIST" .. it doesnt give the song info.

Im on 6.0 .. any help?

It only works on certain music apps by default.

@MishaalRahman Are you sure that the variable "%MARTIST" is a tasker monitored Variable? It seems, that it's not a built-in variable, as I checked on this page. Additionally it doesn't work on my phone (%MTRACK is working fine though).

EDIT: And I can't import the project (it doesn't get recognized by tasker)

You might be right about that, %MARTIST works for me on Gonemad Music Player.
 
  • Like
Reactions: TheGingerlyGamer

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
You might be right about that, %MARTIST works for me on Gonemad Music Player.

Yeah that's what I thought. Google Play Music doesn't deliver %MARTIST and it's no tasker built-in variable. I had a profile which reads aloud the track already. Thought it would be nice, if it read the artist, too. Unfortunately it doesn't seem to work for me, since I really want to stick to Play Music.
What a shame :(
 

o0adam0o

Senior Member
Apr 6, 2007
805
72
Yeah that's what I thought. Google Play Music doesn't deliver %MARTIST and it's no tasker built-in variable. I had a profile which reads aloud the track already. Thought it would be nice, if it read the artist, too. Unfortunately it doesn't seem to work for me, since I really want to stick to Play Music.
What a shame :(

I got it to work with Play Music on Marshmallow.

Someone helped me with this:

"Those built-in variables don't function for all music apps and/or devices, OS, etc.
The best way to go about this is to use the plugin AutoNotification to pull the information directly from the notification in the status bar that displays it (assuming that when you're playing songs there's a notification up there showing Track/Artist).
You would use the Action AutoNotification > Query and specify Play Music as the app, then the track/artist should be available in the returned variables %antext or %antitle."
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
Spotify won't work with this, but you can intercept the notification using AutoNotification or NotificationListener and have it read from there.



It only works on certain music apps by default.



You might be right about that, %MARTIST works for me on Gonemad Music Player.

I got it to work with Play Music on Marshmallow.

Someone helped me with this:

"Those built-in variables don't function for all music apps and/or devices, OS, etc.
The best way to go about this is to use the plugin AutoNotification to pull the information directly from the notification in the status bar that displays it (assuming that when you're playing songs there's a notification up there showing Track/Artist).
You would use the Action AutoNotification > Query and specify Play Music as the app, then the track/artist should be available in the returned variables %antext or %antitle."

That sounds good and I tried it, but unfortunately that's only a paid version feature. I don't know if I'm willing to pay, only that my script reads the artist, too. That seems to be a little exaggerated.
But thank you for the hint.

I will maybe consider trying this later this month and will report, if it works then :)

Cheers
 

middymizzle

New member
Jul 24, 2014
1
4
That sounds good and I tried it, but unfortunately that's only a paid version feature. I don't know if I'm willing to pay, only that my script reads the artist, too. That seems to be a little exaggerated.
But thank you for the hint.

I will maybe consider trying this later this month and will report, if it works then :)

Cheers

Possibly rebooting a dead dog here, but you don't need to buy anything to get this to work with Google Play Music!

GPM outputs a broadcast intent on changes in Metadata.

For your profile context use event>intent received. Input the following for the intent details: Action: com.android.music.metachanged

And that's it!

In your say task linked to this intent you will have the following variables available to you:

%artist
%track
%album
%position (current position in ms)
%duration (song duration in ms)
%playing (returns true if playing, false if paused)
%rating (returns 0 if song is not rated, 1 if song is disliked and 5 if song is liked)

Do with those as you wish!

You could do something as simple as Say>%artist %track. Or you could do IF %rating ~ 1>media button (next) - this will then skip any tracks that you have given thumbs down to.

Hope this helps. Have fun!
 

Follow_and_Feel

Senior Member
Apr 7, 2014
528
216
Montabaur
Possibly rebooting a dead dog here, but you don't need to buy anything to get this to work with Google Play Music!

GPM outputs a broadcast intent on changes in Metadata.

For your profile context use event>intent received. Input the following for the intent details: Action: com.android.music.metachanged

And that's it!

In your say task linked to this intent you will have the following variables available to you:

%artist
%track
%album
%position (current position in ms)
%duration (song duration in ms)
%playing (returns true if playing, false if paused)
%rating (returns 0 if song is not rated, 1 if song is disliked and 5 if song is liked)

Do with those as you wish!

You could do something as simple as Say>%artist %track. Or you could do IF %rating ~ 1>media button (next) - this will then skip any tracks that you have given thumbs down to.

Hope this helps. Have fun!

Wow that's genius! Thanks a lot! Unfortunately and of course I've already bought GMMP Pro :laugh:

But thank you for that information :)

EDIT: This is working perfectly! Thank you so much :) I'm back on GPM :)
 
Last edited:

Maurizio1953

Senior Member
Oct 5, 2011
176
23
Avezzano
I tried your profile but doesn't work as the say command doesn't say the artist and the track name ... maybe I am wrong in something not written here? Which are the correct entries in the intent received context? I put only the action you wrote...


Inviato dal mio iPad utilizzando Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Do you have a bunch of new songs that you listen to while in the car, and would like to learn to associate the song with its track name and artist? Rather than looking at your car's display or your music widget, you can simply have Tasker them aloud when a song starts.

    Prerequisites

    • A compatible music player. Go to this page and search for %MTRACK to see more details.


    Instructions

    1. Create a new profile and name it "Say Track."
    2. Create an Event context, go to Variables --> Variable Set. Set the variable to %MTRACK and leave the value blank.
    3. Create the task but don't name it anything.
    bysCepu.jpg


    1. Task --> Wait. Wait 1 second. This is necessary because %MARTIST sometimes takes a bit more time to be set after %MTRACK is.
    2. Variables --> Variable Split. Name %MARTIST, Splitter is - (a dash).
    3. Alert --> Say. Text: %MTRACK by %MARTIST1. Check If and set it to if %MPLAYSTATE !~ PAUSED AND %SCREEN ~ off. This is so it'll only read the track name and artist if the music isn't paused and if the screen is off.
    4. Alert --> Flash. Text: %MTRACK by %MARTIST1. Check If and set it to if %MPLAYSTATE !~ PAUSED AND %SCREEN ~ on. This will flash the track name and artist if the screen is on and music is playing (obviously).
    XLkVsZY.jpg


    That's it! Let me know if you find this one useful. Also, post below if it works for your music player. I use Gonemad Music Player and it works great for me!

    I've attached the XML file below. To import it, move it to /sdcard/Tasker/Profiles, then open Tasker and long-press on the Profiles tab up top and click on Import.
    4
    That sounds good and I tried it, but unfortunately that's only a paid version feature. I don't know if I'm willing to pay, only that my script reads the artist, too. That seems to be a little exaggerated.
    But thank you for the hint.

    I will maybe consider trying this later this month and will report, if it works then :)

    Cheers

    Possibly rebooting a dead dog here, but you don't need to buy anything to get this to work with Google Play Music!

    GPM outputs a broadcast intent on changes in Metadata.

    For your profile context use event>intent received. Input the following for the intent details: Action: com.android.music.metachanged

    And that's it!

    In your say task linked to this intent you will have the following variables available to you:

    %artist
    %track
    %album
    %position (current position in ms)
    %duration (song duration in ms)
    %playing (returns true if playing, false if paused)
    %rating (returns 0 if song is not rated, 1 if song is disliked and 5 if song is liked)

    Do with those as you wish!

    You could do something as simple as Say>%artist %track. Or you could do IF %rating ~ 1>media button (next) - this will then skip any tracks that you have given thumbs down to.

    Hope this helps. Have fun!
    1
    Thanks, but how can you handle different languages? I mean, you can't listen to English/Japanese/whatever songs/groups/artists in your main language (that's Italian, in my case) as you wouldn't even understand a thing. I tried to implement this long ago for car use via bluetooth and screen off but in the end I had to give up: could you find a solution maybe?
    1
    Is there a way that we can get this to work with Spotify?
    1
    Is there a way that we can get this to work with Spotify?

    I too would like to know this information.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone