mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 08:39:16 +02:00
Resolve "In-place imports cannot be transcoded"
This commit is contained in:
parent
db8427f30c
commit
0efdb6d980
4 changed files with 43 additions and 3 deletions
|
@ -75,5 +75,9 @@ def get_actor_from_request(request):
|
|||
def transcode_file(input, output, input_format, output_format, **kwargs):
|
||||
with input.open("rb"):
|
||||
audio = pydub.AudioSegment.from_file(input, format=input_format)
|
||||
return transcode_audio(audio, output, output_format, **kwargs)
|
||||
|
||||
|
||||
def transcode_audio(audio, output, output_format, **kwargs):
|
||||
with output.open("wb"):
|
||||
return audio.export(output, format=output_format, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue