Merge pull request #1117 from rjhelms/replaygain-py3.5

Fix replaygain_analyzer in Python 3.5
This commit is contained in:
Kyle Robbertze 2020-11-19 22:04:54 +02:00 committed by GitHub
commit 3532f3639b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ class ReplayGainAnalyzer(Analyzer):
command = [ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE, '-d', filename]
try:
results = subprocess.check_output(command, stderr=subprocess.STDOUT,
close_fds=True, text=True)
close_fds=True, universal_newlines=True)
gain_match = r'Calculating Replay Gain information \.\.\.(?:\n|.)*?:([\d.-]*) dB'
replaygain = re.search(gain_match, results).group(1)
metadata['replay_gain'] = float(replaygain)