• Announcements

    • andrewilley

      Poweramp v3 Project Update   04/24/2017

      As you may be aware, the Poweramp developer has been working hard on an updated material design user interface for Poweramp v3 which required a full ground-up rebuild of the code. It is hoped this will be ready for final beta-testing by the end of the May/early June. See forum thread for more details and to discuss.    
Bluescreen2001

Can I send current song info to a web server

5 posts in this topic

Hi,

I built a big LED matrix display for displaying the current song info of my antique DOS based player (see www.trektech.de if you like).

But today I mostly use Poweramp for laying music, so that display keeps dark :-(

Can I somehow get the current song info from Poweramp to the display's webserver? Lets say a plugin do an http-get on song change containing the sng info like this:

http://mydisplay/cmd?name=songname&artist=artistname

Poorly I have no programming skills on Android, so maybe someone can help?

Thank you

Thorsten

Share this post


Link to post
Share on other sites

Poweramp sends current track info via own API and via standard Android API, so you can listen to one of those (with Broadcast Receiver) and re-send to whatever target you need (e.g. http server). Check our SDK for example app.

Thanks!

Share this post


Link to post
Share on other sites

Hi,

I built a big LED matrix display for displaying the current song info of my antique DOS based player (see www.trektech.de if you like).

But today I mostly use Poweramp for laying music, so that display keeps dark :-(

Can I somehow get the current song info from Poweramp to the display's webserver? Lets say a plugin do an http-get on song change containing the sng info like this:

http://mydisplay/cmd?name=songname&artist=artistname

Poorly I have no programming skills on Android, so maybe someone can help?

Thank you

Thorsten

 

You'd need to learn how to get an app running on Android. Once you do, the API calls are pretty easy for this.

 

In the Activity's onCreate (you'll know what this means when you start coding) you enter:

IntentFilter iF = new IntentFilter();iF.addAction("com.maxmpz.audioplayer.TRACK_CHANGED");registerReceiver(mReceiver, iF);

That registers the broadcast receiver so your app gets notified when the track changes. Then you'd have to create an onReceive for the mReceiver registered in the above code. In that onReceive, you can use this:

Bundle track = intent.getBundleExtra("track");string artist = track.getString("artist");string title = track.getString("title");

Now that you have your artist and title, you can call your HTTP GET command.

 

Hope this helps!

Share this post


Link to post
Share on other sites

You can also use Tasker. I set up a task to receive that intent broadcast and i could get the artist and title. It requires no android programming! Only problem is, I don't think Tasker parses bundles, it just gives it as a huge string. So you'll have to parse the string in your website code.

Share this post


Link to post
Share on other sites

I successfully set tasker as in your example above to send track name and other info to a server  (thanks a lot), but how to obtain the same result on STATUS_CHANGED event instead of TRACK_CHANGED event?

 

With TRACK_CHANGED I have the bundle string on %track, but with STATUS_CHANGED (eg. after play/pause) %track is empty

 

 

acording to doc track should exist:

		 * STATUS_CHANGED status value - track has been started to play or has been paused.		 * Note that Poweramp will start track immediately into this state when it's just loaded to avoid STARTED => PAUSED transition. 		 * Additional extras:		 * 	track - bundle - track info 		 * 	paused - boolean - true if track paused, false if track resumed		 *



			
		

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now