This simple script will convert all the wav in a folder into mp3. This will not delete the wav files.
import os os.system("""FOR /F "tokens=*" %G IN ('dir /b *.wav') DO ffmpeg -i "%G" -acodec mp3 "%~nG.mp3" """) # for f in *.wav ; do ffmpeg -i "$f" -acodec libmp3lame -q:a 2 "${f%.*}.mp3"; done
Little utility
I put my scripts into a folder (pymodules in my case) that I added to my python sys path (there is a post about this here). As I got a lot of them and not always is easy to remember how I called them, I made this utility, so that I just have to
py -m utility
to run these scripts
#timer.py import tkinter as tk import os def ppr(): print("click") root = tk.Tk() root.geometry("400x400") root.title("Utility") # root.geometry("400x400") def convert(): os.system("py -m convert_wav_mp3") button = tk.Button(root, text="Converti wav in mp3", command=convert) button.grid(row=2, column=0, sticky="w") root.mainloop()