如何使用Python在os.startfile中播放音频列表
import os
music_dir = "C:\\Users\\JACKSON KASI\\Music"
songs = os.listdir(music_dir)
print(songs)
for i in songs:
os.startfile(os.path.join(music_dir,i))
下一个音频文件应在第一个音频文件完全运行后运行。 但我的代码是快速播放所有音频。这并不完美。 请帮帮我。
您是否可以使用pygame(或)pythonvlc来解决这个问题
os.startfile
只是在后台异步启动文件。每the docs:基本上,你不能将它用于你的目的,因为没有办法知道它何时完成
播放媒体文件有很多很多演练;请在web上搜索解决方案(从头开始提供完整的解决方案有些超出StackOverflow问题的范围)
这会奏效的
相关问题 更多 >
编程相关推荐