added a file converter

This commit is contained in:
janis
2022-11-12 17:29:35 +01:00
parent 2d0b3d6cb1
commit 1bdb73d3e4
6 changed files with 28 additions and 4 deletions

24
converter.py Normal file
View File

@@ -0,0 +1,24 @@
import os
folderpath = input("Type the path to a folder containing to be converted files (excluding final /): ")
files = os.listdir(folderpath)
toberun = []
for file in files:
extension = file[len(file) - 4:]
if extension == ".m4a" or extension == ".wav":
toberun.append(str(folderpath + "/" + file))
for item in toberun:
command = f"ffmpeg -i {item} -acodec mp3 {item[:len(item) - 4]}.mp3"
os.system(command)
print("""
DONE
""")