Skip to content
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

replaygain: albumpeak on large collections is calculated as average,not maximum (bug 3008) #3009

Merged
merged 2 commits into from
Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beetsplug/replaygain.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def compute_gain(self, items, is_album):
i += 1
returnchunk = self.compute_chunk_gain(chunk, is_album)
albumgaintot += returnchunk[-1].gain
albumpeaktot += returnchunk[-1].peak
albumpeaktot = max(albumpeaktot, returnchunk[-1].peak)
returnchunks = returnchunks + returnchunk[0:-1]
returnchunks.append(Gain(albumgaintot / i, albumpeaktot / i))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To compute a maximum, this last / i should be deleted, right?

Copy link
Contributor Author

@vvvrrooomm vvvrrooomm Aug 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

darn. Of course, I forgot to delte that

return returnchunks
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ New features:
* The `absubmit` plugin now works in parallel (on Python 3 only).
Thanks to :user:`bemeurer`.
:bug:`2442`
* replaygain: albumpeak on large collections is calculated as average, not maximum
:bug:`3008`

Fixes:

Expand Down