else:
command = ['sox'] + filenames + ['-t', 'wav', '-']
-if start != floor_start or end != ceil_end:
- trim_parts = ['trim']
- if start != floor_start:
- trim_start = (start - floor_start).seconds
- trim_parts.append(str(trim_start))
- else:
- trim_start = 0
- if end != ceil_end:
- if trim_start:
- duration = (end - start).seconds
- trim_parts.append(str(duration))
- else:
- trim_end = (ceil_end-end).seconds
- trim_parts.append(str(trim_end))
- command.extend(trim_parts)
+# trim
+command.append('trim')
+command.append('=%s' % (start - floor_start).seconds)
+command.append('=%s' % (end - floor_start).seconds)
if '--test' in sys.argv:
print ' '.join(command)
else:
os.system(' '.join(command))
-