Tasker Is Music Playing Plugin
by Harena Mons
🗂️ Tools
Version 1,000+
📅 Updated Learn More
A must-have for all Tasker users who need to know if music is currently playing.
Features Tasker Is Music Playing Plugin
---=== Please note that this plug-in requires the application Tasker to be installed before use ===---Are you a Tasker user?
Do you need to know if music is currently playing for you to set up your tasks correctly?
If yes on both questions, then this plug-in is written especially for you.The plug-in itself uses no resources whatsoever when not used, no services are used.
The memory footprint is minimal even when executing.When installed, you will be able to ask the system if any application is currently playing audio through the media stream.
The Media stream is used by all media players such as Google music, Spotify, Audio Book players etc.This plug-in uses a two step process to achieve this, since Android system currently doesnt support a straight forward interrupt mechanism for discovering if music is played.This is how you will get things done in Tasker:Step 1, set up a State profile.Context: 1.
Is Music Playing?
-> YesTask:1.
Set %IS_MUSIC_PLAYING = 1Exit task:1.
Clear %IS_MUSIC_PLAYINGSince Android doesnt support interrupt based handling on playing music, you have to ask the system if music is playing before you act on your %IS_MUSIC_PLAYING variable.Step 2, Ask the system if music is playing according to the following guide:Context: 1.
"When do you want to check if music is playing?"Task:1.
"Your logic before the check is needed"2.
Plug-ins -> Is Music Playing?
-> Query system (This will force an update of %IS_MUSIC_PLAYING via the first profile)3.
Wait 500ms (In order to let the first profile have time to populate %IS_MUSIC_PLAYING correctly)4.
If %IS_MUSIC_PLAYING is set 5.
"Your logic if music is playing"6.
Else (Step 5 above will happen if %IS_MUSIC_PLAYING is set, step 7 below will happen if %IS_MUSIC_PLAYING is not set.) 7.
"Your logic if music is not playing"8.
End if9.
"Your logic after the check is done"An example of how to use it when you get an incoming text message and want to read it out loud.
Then music should be paused, but only if it is currently playing.Context: 1.
Incoming text messageTask:1.
Wait around 2 seconds, depending on how long your message alert is (This needs to be done since the message alert signal will pause the music)2.
Plug-ins -> Is Music Playing?
-> Query system3.
Wait 500ms 4.
If %IS_MUSIC_PLAYING is set 5.
Pause music 6.
Read text message out load 7.
Play music8.
Else 9.
Read text message out load10.
End ifUser feedback states that if you toggle play/pause in a task just before you want to check if music is playing, dont forget to add about a 1 second delay to ensure that the toggle is happening on the device before the check.If you have problems with anything, send a mail and I will sort it out.Some questions has been raised regarding Tasker 4.0+ compatibility for this plug-in.
It is compatible with both pre and post 4 versions of Tasker.
Secure & Private
Your data is protected with industry-leading security protocols.
24/7 Support
Our dedicated support team is always ready to help you.
Personalization
Customize the app to match your preferences and workflow.
See the Tasker Is Music Playing Plugin in Action
What Our Users Say
Don't just take our word for it. Here's what our users have to say about our Android app.
"No update since 2013, abandoned and broken on 10."
Raja Swaminathan
"Not working consistently on pie s8. Thanks anyway, it was worth a shot."
Skynet Robocop
"It does not work."
Fabricio Breve
"Perfect, just perfect!"
Renato Carbone
"Doesn't work"
Robert Harris
"Worked really well initially, but since past few days it takes almost 30s for the 'is music playing' state-profile to activate once 'query system' task is executed. I'm on marshmallow, and running tasker 4.9u4 (which was last updated in Jan '17) so I don't think an app update is involved. I verified that tasker is' not optimized' in Android battery optimization settings, and also 'reduce resource usage' in not set in tasker settings. Is there a way I can debug this? Perhaps some logs I could enable and examine? Any guidance is appreciated..."
Ashish Chopra
"tried to catch media output from navigation software so device could turn on the screen whenever something was up, but it did not really work. sometimes this plugin realized the sound, sometimes not. for this purpose not usable, otherwise does what it says. a little pricey considering there is only one functionality to it, thus only 4 stars."
Alexander Remus
"The missing cog in my music profiles! Perfect for restricting a context to when music is actually being played, as opposed to the music app just being open or downloading something e.g. the profile doesn't trigger when I'm browsing my Spotify library, or when Spotify starts downloading music because I've just connected to a Wi-Fi network."
Gabriel Feo
"I didn't understand the instructions but not because they're bad, I'm just a dumbass. Now I've got it working it's amazing. Thanks so much for making this."
Chris
"Takes a bit of time to figure out how to use. However, it works and I am very happy."
Mikyas Wolde
Get the App Today
Available for Android 8.0 and above