CC-3018: Automatically strip out silence from audio tracks

- adding try/catch
This commit is contained in:
James 2013-01-03 14:07:34 -05:00
parent b8f80866cf
commit f936f510c5

View file

@ -170,12 +170,15 @@ def normalize_mutagen(path):
md['path'] = normpath(path) md['path'] = normpath(path)
# silence detect(set default queue in and out) # silence detect(set default queue in and out)
command = ['silan', '-f', 'JSON', md['path']] try:
proc = subprocess.Popen(command, stdout=subprocess.PIPE) command = ['silan', '-f', 'JSON', md['path']]
out = proc.stdout.read() proc = subprocess.Popen(command, stdout=subprocess.PIPE)
info = json.loads(out) out = proc.stdout.read()
md['cuein'] = info['sound'][0][0] info = json.loads(out)
md['cueout'] = info['sound'][-1][1] md['cuein'] = info['sound'][0][0]
md['cueout'] = info['sound'][-1][1]
except Exception:
raise
if 'title' not in md: md['title'] = u'' if 'title' not in md: md['title'] = u''
return md return md