added a file converter
This commit is contained in:
24
converter.py
Normal file
24
converter.py
Normal 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
|
||||
|
||||
|
||||
""")
|
||||
Reference in New Issue
Block a user