CC-3018: Automatically strip out silence from audio tracks
- adding try/catch
This commit is contained in:
parent
b8f80866cf
commit
f936f510c5
1 changed files with 9 additions and 6 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue