CC-4665: ReplayGain does not work for FLAC files

-fixed
This commit is contained in:
Martin Konecny 2012-11-05 11:52:11 -05:00
parent 1472eb5e51
commit d89166e2ff
1 changed files with 10 additions and 1 deletions

View File

@ -105,7 +105,16 @@ def calculate_replay_gain(file_path):
logger.warn("vorbisgain/ogginfo not found")
elif file_type == 'flac':
if run_process("which metaflac > /dev/null") == 0:
out = get_process_output('nice -n %s metaflac --show-tag=REPLAYGAIN_TRACK_GAIN "%s"' % (nice_level, temp_file_path))
command = 'nice -n %s metaflac --add-replay-gain "%s"' \
% (nice_level, temp_file_path)
run_process(command)
command = 'nice -n %s metaflac \
--show-tag=REPLAYGAIN_TRACK_GAIN "%s"' \
% (nice_level, temp_file_path)
out = get_process_output()
search = re.search(r'REPLAYGAIN_TRACK_GAIN=(.*) dB', out)
else: logger.warn("metaflac not found")