Files
MusicPlayerV1/converter.py
2022-11-12 17:29:35 +01:00

24 lines
475 B
Python

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
""")