Info from music player
Moderator: Martin
Info from music player
Would it be possible to have a trigger fire when I start playing music or the song changes? Maybe with general broadcast? Also, is it possible to retrieve the tag info from currently playing song, specifically artist and song name?
I'd like tohave a flow which shows that info in toast when in full screen app and status bar isn't available.
I'm using powerAMP.
I'd like tohave a flow which shows that info in toast when in full screen app and status bar isn't available.
I'm using powerAMP.
Re: Info from music player
Some music players send a broadcast with the track info that can be received with a trigger General Broadcast.
Following settings work for Play Music:
Action:
com.android.music.metachanged
Access Intent extras:
artist = getString("artist");
album = getString("album");
track = getString("track");
I found somewhere on the web that following action might work for PowerAMP (untested):
com.maxmpz.audioplayer.TRACK_CHANGED
Following settings work for Play Music:
Action:
com.android.music.metachanged
Access Intent extras:
artist = getString("artist");
album = getString("album");
track = getString("track");
I found somewhere on the web that following action might work for PowerAMP (untested):
com.maxmpz.audioplayer.TRACK_CHANGED
Re: Info from music player
com.maxmpz.audioplayer.TRACK_CHANGED. This works well in both starting a new song or resuming playback.
How should I use following?
Access Intent extras:
artist = getString("artist");
album = getString("album");
track = getString("track");
EDIT: I found PowerAMP's api at github. I found the relevant things in there but I have no idea what should Ido with them to put the track info in a variable. https://github.com/maxmpz/powerampapi/b ... mpAPI.java
How should I use following?
Access Intent extras:
artist = getString("artist");
album = getString("album");
track = getString("track");
EDIT: I found PowerAMP's api at github. I found the relevant things in there but I have no idea what should Ido with them to put the track info in a variable. https://github.com/maxmpz/powerampapi/b ... mpAPI.java
Last edited by MURTUMA on 23 Dec 2013 21:12, edited 1 time in total.
Re: Info from music player
Automagic can not access the track info yet since PowerAMP stores this info in a type 'Bundle' which is not supported in Automagic.
I can add support to access a Bundle for the next version.
The script will probably look something like this:
I can add support to access a Bundle for the next version.
The script will probably look something like this:
Code: Select all
track_info = getBundle("track");
title = getString(track_info, "title");
Re: Info from music player
I seem to have been too tired post a link there, but hopefully you found that yourself. That update would be good. Thanks!
Re: Info from music player
After last update,I believe it's time to give this question a little bump. How do I get the relevant info from bundle?
Re: Info from music player
The help page of trigger General Broadcast contains an example to access the intent extras of PowerAMP. Scroll down to the last section of field Access Intent Extras.
The action of the trigger should be set to com.maxmpz.audioplayer.TRACK_CHANGED to receive the intent.
The action of the trigger should be set to com.maxmpz.audioplayer.TRACK_CHANGED to receive the intent.
Re: Info from music player
Äh.. I checked there but missed that. Thanks!
I got the flow up and running good.
However.. The duration variable is in seconds. I managed to format it to 1m 10s (times are correct, this is just for an example). How can I format it to 1:10 instead?
http://automagic4android.com/flow.php?i ... 0a3f6f087e
I got the flow up and running good.
However.. The duration variable is in seconds. I managed to format it to 1m 10s (times are correct, this is just for an example). How can I format it to 1:10 instead?
http://automagic4android.com/flow.php?i ... 0a3f6f087e
-
- Posts: 186
- Joined: 12 Feb 2014 01:45
Re: Info from music player
Seems as you have the same problem as I posted below earlier today getting the format 1minute 10 seconds to 1:10 

Best regards,
AngelAtwOrk
AngelAtwOrk
-
- Posts: 186
- Joined: 12 Feb 2014 01:45
Re: Info from music player
Seems as you have the same problem as I posted below earlier today getting the format 1minute 10 seconds to 1:10 

Best regards,
AngelAtwOrk
AngelAtwOrk