Autodetect format when transcoding files

This commit is contained in:
interfect 2021-01-21 15:11:53 +01:00 committed by Agate
commit 7f42c1ad44
4 changed files with 24 additions and 3 deletions

View file

@ -855,8 +855,7 @@ class Upload(models.Model):
if not input:
return
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):