Finding filename of current playing track using tcp command

You have a question or need an advice about how to do something? Ask it here!
Post Reply
phonic
Posts: 327
Joined: 06 Mar 2019 14:45
Finding filename of current playing track using tcp command

Post by phonic »

I’m trying obtain via TCP the Filename of the current playing track so I can identify the stream name(http://ipAdsress/studioName) I tried using ping ${filename) but it’s blank. I can’t use meta data(cpltracknamecurrent, etc) as they show the current title and artist as sent via the stream.
What command or macro would I use for this?
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Finding filename of current playing track using tcp command

Post by radio42 »

I am afraid, that there is currently no macro to retrieve the filename and path of the current playing track!
Almost all meta data is available, but not the filename!
Why is a filename needed to be exposed to external systems?
phonic
Posts: 327
Joined: 06 Mar 2019 14:45
Re: Finding filename of current playing track using tcp command

Post by phonic »

radio42 wrote: 22 May 2020 21:56 I am afraid, that there is currently no macro to retrieve the filename and path of the current playing track!
Almost all meta data is available, but not the filename!
Why is a filename needed to be exposed to external systems?
I need to know if it’s a stream and if so the name of the stream connected so the correct on-air notification can be set. Ideally, return the URL of the stream of current player(if it is a stream).
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Finding filename of current playing track using tcp command

Post by radio42 »

As said, there is currently no direct macro. But you can create your own :

In the Streaming.OnSongTitleChanged Event you can use the following command to store the last tracks filename:
EXEC_VAR_SET lastfile|${filename}

As this event is a track event you can use the ${filename} macro and store it’s content into a new variable called ‘lastfile’.

In your PING command you can now retrieve it back:
PING ${VAR:lastfile}

That should work as you need it.
phonic
Posts: 327
Joined: 06 Mar 2019 14:45
Re: Finding filename of current playing track using tcp command

Post by phonic »

radio42 wrote: 23 May 2020 00:37 As said, there is currently no direct macro. But you can create your own :

In the Streaming.OnSongTitleChanged Event you can use the following command to store the last tracks filename:
EXEC_VAR_SET lastfile|${filename}

As this event is a track event you can use the ${filename} macro and store it’s content into a new variable called ‘lastfile’.

In your PING command you can now retrieve it back:
PING ${VAR:lastfile}

That should work as you need it.
I'll give it a go. Thanks for your help!
phonic
Posts: 327
Joined: 06 Mar 2019 14:45
Re: Finding filename of current playing track using tcp command

Post by phonic »

radio42 wrote: 23 May 2020 00:37 As said, there is currently no direct macro. But you can create your own :

In the Streaming.OnSongTitleChanged Event you can use the following command to store the last tracks filename:
EXEC_VAR_SET lastfile|${filename}

As this event is a track event you can use the ${filename} macro and store it’s content into a new variable called ‘lastfile’.

In your PING command you can now retrieve it back:
PING ${VAR:lastfile}

That should work as you need it.
Worked fine, however to get next and now on-air stream info I set two new vars and used “ontrackload” and “ontitlechanged”. I was using “ontrackplay” but quickly noticed while News was playing filename VAR was not updated with the new track to be played and thus giving a false status.

works fine now... I hope 🤞

Post Reply