Merge pull request #2152 from lissyx/fix-frames

Ensure frames counter is initialized
This commit is contained in:
lissyx 2019-06-06 11:16:52 +02:00 committed by GitHub
commit 3572ded5da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,7 @@ def _maybe_convert_set(input_tsv, audio_dir, label_filter, space_after_every_cha
wav_filename = path.splitext(mp3_filename)[0] + ".wav"
_maybe_convert_wav(mp3_filename, wav_filename)
file_size = -1
frames = 0
if path.exists(wav_filename):
file_size = path.getsize(wav_filename)
frames = int(subprocess.check_output(['soxi', '-s', wav_filename], stderr=subprocess.STDOUT))