Author Topic: flac files mysteriously changed to .tmp  (Read 879 times)

ultrarunner2018

  • Jr. Member
  • **
  • Posts: 42
Hello;
I have been updating my music library, which is stored as .flac on my system.
I play tracks through MusicBee on Windows 10, but use Tag & Rename to tag the files.
I have both apps running on Windows 10 (latest build).
Occasionally, when playing a track in MusicBee, and opening that same track in Tag & Rename to set the ratings, I get an error from T&R telling me that it cannot find the file. When I open Windows file explorer, I see that the file has a .tmp instead of .flac extension.
I understand that I cannot save tags in T&R while the track is playing in MB, so I will always play another track before saving in T&R.
This extension changed to .tmp has only happened about half dozen times in all, and I am always able to recover the file by changing its extension from .tmp to .flac.

I am at a loss to what is happening. I don't know if the problem is with MusicBee or Tag & Rename, but when I searched through my Users/<username>/AppData/Local/MusicBee/InternalCache/ArtistBackdrops folder, I see many files with .tmp extension, so I am assuming it is MusicBee that is changing the file extension.

Any ideas?
Thanks
Ultrarunner

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34406
when MB saves FLAC files. in some cases a temporary file needs to be created. However that file is created in the windows local temp folder and not the music folder. I cant speak for what Tag&Rename does
Note that if you are playing the file while updating in Tag & Rename, that app wont be able to replace the playing track

ultrarunner2018

  • Jr. Member
  • **
  • Posts: 42
The problem seems to occur when I have the file open in MB and try to save it (with updated tags) in T&R, but the mystery is why it doesn't happen every time. Normally, if I try to save the file in T&R while it's open in MB I get the error "cannot open the file... being used by another process..." When the file is changed to .tmp, I get the error "can't find the file..." And then, of course MB cannot find it either.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34406
As a guess T&R will probably only create a temp file if there is not enough room for the new tags, so it needs to recreate the file

ultrarunner2018

  • Jr. Member
  • **
  • Posts: 42
I don't understand. Space for the new tags? Is there a limited number of bits allowed for tags in a .flac file? If so, then why is this happening only occasionally?
I guess I'm going to have to start documenting the problem. I'll make a note of the file(s) that cause the problem.

hiccup

  • Sr. Member
  • ****
  • Posts: 7937
I don't understand. Space for the new tags?
I am guessing it is about the space that is available for metadata within the flac file.
If it previously had '123' as some tag value, and you make it '123456', more space is needed.
I know that for mp3 there are things in place to reserve some additional (blank space) for that, I am not sure if the same goes for flac.

Probably slightly off-topic but still curious: why would you want to use another tagger to edit ratings of files that reside in your MusicBee library?

vincent kars

  • Sr. Member
  • ****
  • Posts: 447
FLAC has METADATA_BLOCK_PADDING: https://xiph.org/flac/format.html#metadata_block_padding
I believe 4000 is the default but to lazy to check.

The moment you embed Cover Art, you most likely forces a rewrite.

ultrarunner2018

  • Jr. Member
  • **
  • Posts: 42
Quote
I am guessing it is about the space that is available for metadata within the flac file.
If it previously had '123' as some tag value, and you make it '123456', more space is needed.
I know that for mp3 there are things in place to reserve some additional (blank space) for that, I am not sure if the same goes for flac.

Probably slightly off-topic but still curious: why would you want to use another tagger to edit ratings of files that reside in your MusicBee library?

OK. That makes sense. I was reading somewhere that .flac doesn't fully support metadata tags anyway.
Why do I use T&R to tag my files ratings rather than just do it in MB?
My intent is to have the ratings (and other meta tags) I set in T&R to be read by PowerAmp on my Android phone.
When I write ratings tags in MB, they are not displayed by T&R, but when I write them in T&R, then do a rescan in MB, I see the new ratings in MB. It appears that T&R ratings override MB's own ratings.
I was hoping that the ratings I set (either in MB or T&R) would be read by PowerAmp on my Android phone (after copying the files from my PC to the phone), but unfortunately PA does not read the tags set by either MB or T&R.

It appears that each app has its own method of writing metadata, or I may not be using the same version (idv2 vs idv3?) on all apps. It is frustrating, and confusing.
So I guess if PA isn't reading tags I set in T&R, then I might as well just use MB's tags.
By setting ratings tags, I can easily find my favorite tracks, then copy them to my phone. I only want 3 stars and higher on the phone, but sometimes will listen to lower rated tracks through MB on my PC.
If I was able to get PA to read the tags I set in MB or T&R, then I could use ratings to quickly select my most favorite tracks on my phone as well as on MB. But so far I have not been able to get PA to read tags set either in MB or T&R.

Perhaps if I used MP3 instead of .flac, the tagging would be more compatible across apps, but I prefer the lossless format.
I'm going to do some experimentation, and maybe I'll make a discovery that will resolve the whole issue of tagging once and for all, but my intuition is telling me that this will not happen with .flac files.
I think there's also something referred to as a 'chunk' that is used by .flac, which is different than what MP3 files use to store metatata.

Following the link vincent kars provided, I find it too much to take in at the moment.
I might have given up on MusicBee, and switched to Media Monkey, which I already have installed on my Android phone, and could sync between the PC and phone, but I have issues with MM while playing certain games, but don't have the issue with MB. Besides that, I have come to enjoy MB; I only wish there was an Android version that would sync between PC and phone.

Editt: Checking the Preferences > Tags(1) tab I find that 'store ratings in the music file' is ticked.
I am not currently using any of the custom tags, which are by default set to save to MusicBee database only.
Is there anything else I should try?
Last Edit: April 15, 2022, 02:13:30 PM by ultrarunner2018

hiccup

  • Sr. Member
  • ****
  • Posts: 7937
Flac (vorbis comment) does not have a standardised format for rating.
Some software uses a scale from 1 to 5, other a scale from 10 to 100.

MusicBee writes 10-100, but will also read 1-5 that is written by other applications.
So you could ask the developers of PowerAmp to have their app also read 10-100.

b.t.w.
I briefly tried if the Additional Tagging and Reporting Tools plugin could be used to transform these values, but I couldn't get it to work.
When I try replacing a rating value of e.g. '80' with '4', '80' will get written anyway, not '4'.
Strange.
Perhaps somebody else knows a trick to make this work?