Page 1 of 2

New control command: Alter song information

Posted: 04 Nov 2021 09:31
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.

Re: New control command: Alter song information

Posted: 04 Nov 2021 18:43
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.

Re: New control command: Alter song information

Posted: 04 Nov 2021 18:45
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?

Re: New control command: Alter song information

Posted: 04 Nov 2021 20:20
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.

Re: New control command: Alter song information

Posted: 23 Nov 2021 15:55
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.

Re: New control command: Alter song information

Posted: 23 Nov 2021 20:11
by radio42
I listed the RATING value (numeric from 0 to 100) even in my post above. So yes, that is supported: rating

Re: New control command: Alter song information

Posted: 23 Nov 2021 20:19
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?

Re: New control command: Alter song information

Posted: 23 Nov 2021 21:05
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!

Re: New control command: Alter song information

Posted: 23 Nov 2021 21:11
by Thijmen
Hi Bernd, awesome to hear this! When will this next version be rolled out? :)

Re: New control command: Alter song information

Posted: 23 Nov 2021 21:32
by radio42
No fixed date yet. Soon...