mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 08:49:25 +02:00
Autodetect format when transcoding files
This commit is contained in:
parent
3e62f8b361
commit
7f42c1ad44
4 changed files with 24 additions and 3 deletions
|
@ -105,7 +105,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):
|
||||
with input.open("rb"):
|
||||
audio = pydub.AudioSegment.from_file(input, format=input_format)
|
||||
return transcode_audio(audio, output, output_format, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue