-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Save metadata on the same file, not in another #69
Comments
Sorry to disappoint you. What applications typically do is save the file with a different name, then delete the original file (or rename it to something else) and then rename the newly saved file to have the original filename. For example, if you open a file called
This is very straightforward to do and shouldn't be a reason not to use mp3agic. See issue #8 |
Many thanks for your answer, but I still don't understand it. |
Of course it's NOT a OS restriction. It's just bad design : when writing the new mp3 file, the MPEG frames are copied from the old one, (in the saveMpegFrames method ), so if both the new and the old file are the same, there's nowhere to read from because the file gets truncated on creation. A better approach would have been to read the frames in memory, THEN write the file. It's not like we're talking about Gb-sized files. Or if the memory is such a huge concern, it could have been the library the one creating the temporary file, or - even better - shifting the bytes in place as needed (forward or backward) to adjust for the change in the metadata size. |
What I don't understand is why the developer, knowing what the issue is, would blame it on the OS. Anyway, here's a fix. Took just one hour: |
Hi, I started editing the mp3 tags using mp3agic and it worked well.
But I am a little dissapointed that when the metadata is to be saved it has to go to a new file, not the same file.
I know that to save the edited tags in the same file is possible as VLC, Winamp and other programs do it. And I want the program I am doing to do it as well.
Is that possible using mp3agic? if not, can you suggest me another library that is able to do it?
I hope and thank your answers.
The text was updated successfully, but these errors were encountered: