New control command: Alter song information

You are missing a feature or need an enhancement? Post your suggestion here!
Thijmen
Posts: 92
Joined: 16 Jul 2019 20:19
New control command: Alter song information

Post by Thijmen »

Hi,

I am doing a bit of an automation with a project of mine and I was wondering if the following was possible.
I am creating a web interface (files are being indexed with some script) and I want to alter the RATING but also the Title and Artist of a song.

As I don't want to change the files directly from the webinterface, I was thinking of having this as a new control command: I would send a control command to change a property of a song, e.g. RATING or TITLE.

When PF receives this, it changes the property of the song in the same way as the Editor would do.

Having this feature would be tremendously helpful.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: New control command: Alter song information

Post by radio42 »

That is already existing ;-)
See the "EXEC_TAG_FILE" command with the parameters: <filename>|<tag>=<value>[|<tag>=<value>]|...
Supported tag names are title, album, artist, albumartist, composer, genre, year, comment, copyright, encodedby, publisher, conductor, grouping, mood, isrc, lyricist, producer, remixer, style, energy, rating, tracknr, discnr

Example:

Code: Select all

EXEC_TAG_FILE C:\test.mp3|title=This is an Title|artist=The Artist|rating=85
A string value can not contain the characters | and =. Rating is a numeric value between 0 and 100.
Thijmen
Posts: 92
Joined: 16 Jul 2019 20:19
Re: New control command: Alter song information

Post by Thijmen »

Oh my.... I did search the docs - but did not find this.

Out of curiousity: what happens if you edit the file while it's playing?
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: New control command: Alter song information

Post by radio42 »

TAGs are written. An audio file is open for read in shared mode always.
What exactly happens depends where the TAGs are located within the audio file. If they are located at the end of a file, changing them will just append them to the file.
In most cases however they are located at the beginning of a file (eg. ID3v2). This might result (when the existing meta data chunk is too small to hold the changes) in moving the entire data chuck. And this might result in a noticeable audio glitch during playback.
Thus I would not recommend doing that.
Thijmen
Posts: 92
Joined: 16 Jul 2019 20:19
Re: New control command: Alter song information

Post by Thijmen »

Im sorry, but I also would like to see RATING in the list of possible options. Now it's 'title', 'artist', 'album',
'albumartist', 'genre', 'comment', 'composer', 'year', 'copyright',
'publisher', 'encodedby'.

Or you mentioned that Rating IS possible, is the documentation outdated?

EDIT: The RATING does not seem to work, "artist" etc do work.
Last edited by Thijmen on 23 Nov 2021 16:32, edited 1 time in total.
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: New control command: Alter song information

Post by radio42 »

I listed the RATING value (numeric from 0 to 100) even in my post above. So yes, that is supported: rating
Thijmen
Posts: 92
Joined: 16 Jul 2019 20:19
Re: New control command: Alter song information

Post by Thijmen »

Check, just wanted to double check. If I do this with a WAV file, it does not seem to work.

Command I use that does not work: `EXEC_TAG_FILE Y:/file.wav|rating=80`
Command I used that DOES work: `EXEC_TAG_FILE Y:/file.wav|artist=test`

I validate my results by going to the Directory Explorer in PF and then right mouse button on the file.wav -> Edit TAGs.

Whatever I try to do, rating does not change.

Am I missing something here?
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: New control command: Alter song information

Post by radio42 »

Just used this command and that worked very well:

Code: Select all

EXEC_TAG_FILE C:\test.wav|artist=test|rating=80
But I just recognized, that when trying to save only numeric values alone, I forgot to set a certain flag, which prevented saving those values effectively. E.g. only changing the rating value alone would currently not work. This will be fixed in the next version!
Thijmen
Posts: 92
Joined: 16 Jul 2019 20:19
Re: New control command: Alter song information

Post by Thijmen »

Hi Bernd, awesome to hear this! When will this next version be rolled out? :)
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: New control command: Alter song information

Post by radio42 »

No fixed date yet. Soon...

Post Reply