from pydub import AudioSegment
import os
path = r'D:\Users\Downloads\10 Music\music2023'
for filename in os.listdir(path):
# filename = r'愿与愁.flac'
if filename.endswith(".flac"):
file_input = path + '\\' + filename
print(file_input)
filename_output = filename.replace(".flac", ".mp3")
file_output = path + '\\' + filename_output
# print(file_output)
song = AudioSegment.fro