import ffmpeg import uuid import pathlib def process(input_media): temp_dir = "./env/tmp" pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True) temp_name = temp_dir + str(uuid.uuid4()) + ".wav" stream = ffmpeg.input(input_media) stream = ffmpeg.output(stream, temp_name) ffmpeg.run(stream) return temp_name