【发布时间】:2023-01-04 04:51:50
【问题描述】:
好吧,我正在研究音乐播放器,但它无法正常工作 所以问题是当我使用 playsound 库播放音乐时它会阻止代码运行并冻结 tkinter 窗口但我搜索并发现您可以将 block 设置为 False 但是当它设置为 false 时音乐不会播放。
这是代码:
from playsound import playsound as psound
#a loop here where i get the directory of musics and create a button for every music and each of the button's command value is set to the 'play_sound' function and passing the music directory as argument
def play_aux(self, dir):
psound(dir, False)
【问题讨论】:
-
请提供minimal, reproducible example。还要指定任何第三方库和指向您引用的外部资源的链接。
-
好的,嗯,我取出了一些代码,现在好了吗,还是我应该添加循环?
标签: python playsound python-playsound