Project Alpha 2
This commit is contained in:
12
media_convert.py
Normal file
12
media_convert.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
Reference in New Issue
Block a user