Created
March 24, 2022 19:09
-
-
Save Yilmaz4/e3926902755227e4fd35c32e1c066719 to your computer and use it in GitHub Desktop.
Convert every single *.mp4 file to *.mp3 in the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from moviepy.editor import * # Install with "pip install moviepy" command | |
import os | |
for file in [file for file in os.listdir() if os.path.splitext(file)[1] == ".mp4"]: | |
video = VideoFileClip(file) | |
video.audio.write_audiofile(os.path.splitext(file)[0] + ".mp3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment