-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make R128 fields floats #4195
Make R128 fields floats #4195
Conversation
Overall seems like it will (a) do the job and (b) be harmless!! Could you please tack on a quick changelog entry describing the fix? Then I think we should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great; thanks!! I'll merge this now.
The one thing that worries me slightly is that using floats here is somewhat likely to create a kind of "infinite write
/update
cycle" where it's impossible to get the database to perfectly match metadata tags. That is, running beet write
or beet update
to sync the database information with the on-disk tags will show a change in precision, even when run twice. That's not a huge deal, obviously, but maybe we'll want to fix it down the line by introducing a fixed-point database type.
Do we need to upgrade the database here and issue a warning to user's that they should consider re-running the replaygain calculation? |
That's a good question… I believe everything will continue to work as it did before for people with existing databases (with integers in the SQLite column) because the Of course, users may still want to re-run RG to calculate more precise values. But I can't immediately think of a good way to elegantly detect this situation and issue a warning… |
You seem to be right, since SQLite has no strict types, only type affinities. From a quick glance, our database upgrade code will only check if there's a mismatch in existing and expected column names, but not type affinities.
We could detect that the |
Description
Fixes #4169
r128_*_gain
fields are used to store LU values internally and are converted to Q7.8 (i.e.int(LU * 256)
) inmediafile
To Do
docs/
to describe it.)docs/changelog.rst
near the top of the document.)