+ def get_duration(self, input_paths):
+ d = 0
+ for input_path in input_paths:
+ d += get_duration(input_path)
+ if self.intro_flac:
+ d += get_duration(self.intro_flac.path)
+ if self.outro_flac:
+ d += get_duration(self.outro_flac.path)
+ return d
+
+ def prepare_audio(self, input_paths):
+ files = []
+ if self.intro_flac:
+ files.append(standardize_audio(self.intro_flac.path))
+ for input_path in input_paths:
+ files.append(standardize_audio(input_path, cache=False))
+ if self.outro_flac:
+ files.append(standardize_audio(self.outro_flac.path))
+ output = concat_audio(files)
+ for d in files:
+ unlink(d)
+ return output
+