获取一个音频的时长
...小于 1 分钟
安装依赖
pip install pydub
code
import os
import shutil
try:
from pydub.utils import mediainfo
except:
os.system("pip3 install pydub")
from pydub.utils import mediainfo
def count_time(file_path):
song = mediainfo(file_path)
return float(song["duration"])
Powered by Waline v3.1.3