Spaces:
Sleeping
Sleeping
| from moviepy import VideoFileClip | |
| def extract_audio(video_path: str, output_path: str = "audio.wav") -> str: | |
| # Force output path to be in /tmp | |
| output_path = f"/tmp/{output_path}" | |
| video = VideoFileClip(video_path) | |
| video.audio.write_audiofile(output_path, codec="pcm_s16le") | |
| return output_path | |