else:
ceil_end = ceil_end.replace(minute=(1+(ceil_end.minute/15))*15)
-os.chdir(BASE_DIR)
+if type(BASE_DIR) is str:
+ os.chdir(BASE_DIR)
def get_filenames():
path = start.strftime(PATH_LAYOUT)
return filenames
while True:
- filenames = get_filenames()
+ if type(BASE_DIR) is list:
+ filenames = []
+ for base_dir in BASE_DIR:
+ os.chdir(base_dir)
+ filenames.extend([os.path.join(base_dir, x) for x in get_filenames()])
+ filenames.sort()
+ else:
+ filenames = get_filenames()
+
without_extension = [os.path.splitext(x)[0] for x in filenames]
for f in without_extension:
if without_extension.count(f) > 1:
else:
command = ['sox'] + filenames + ['-t', 'wav', '-']
-if filenames[0].endswith('.wav'):
- # files get compressed after a while, and they lose their original creation
- # time
- creation_time = time.localtime(os.stat(filenames[0])[-3])
- daytime_as_filename = '%02dh%02d' % creation_time[3:5]
- if not (daytime_as_filename in filenames[0] and creation_time[5] == 0):
- floor_start = datetime.datetime(*creation_time[:6])
-
if start != floor_start or end != ceil_end:
trim_parts = ['trim']
if start != floor_start: