Commit 9ac829fa authored by interfect's avatar interfect
Browse files

Autodetect format when transcoding files

parent 68bc76bc
Pipeline #13159 failed with stages
in 6 minutes and 14 seconds
......@@ -855,8 +855,7 @@ class Upload(models.Model):
if not input:
input_format = utils.MIMETYPE_TO_EXTENSION[self.mimetype]
audio = pydub.AudioSegment.from_file(input, format=input_format)
audio = pydub.AudioSegment.from_file(input)
return audio
def save(self, **kwargs):
......@@ -101,7 +101,7 @@ def get_actor_from_request(request):
return actor
def transcode_file(input, output, input_format, output_format, **kwargs):
def transcode_file(input, output, input_format=None, output_format="mp3", **kwargs):
audio = pydub.AudioSegment.from_file(input, format=input_format)
return transcode_audio(audio, output, output_format, **kwargs)
Changed audio format detection to happen via sniffing and not file extensions (#1274)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment