file_path = soundfile.get_format_path(format)
created = False
if not os.path.exists(file_path) or force:
- self.create(soundfile, format)
- created = True
+ created = self.create(soundfile, format)
if created or reset_metadata:
self.set_metadata(soundfile, format)
- if not soundfile.duration:
+ if not soundfile.duration and os.path.exists(soundfile.get_format_path('ogg')):
cmd = ['soxi', '-D', soundfile.get_format_path('ogg')]
soundfile.duration = int(float(subprocess.check_output(cmd)))
soundfile.save()
cmd[1:1] = ['-loglevel', 'quiet']
subprocess.call(cmd)
+ return os.path.exists(file_path)
def set_metadata(self, soundfile, format):
file_path = soundfile.get_format_path(format)