2017-08-12 161 views

回答

1

在循环开始处包含代码playsound = True。然后在循环把下面:

if playsound: 
    # Play the sound 
    playsound = False 

把当前的命令代替# Play the sound玩,它可能看起来像sound.play()

+0

我失败了.Python没有打。 – Inteyerry

+0

你有没有把命令放在if语句中播放声音?如果你现在的代码是'MySound.play()',这需要代替'#播放声音'如果你发布了完整的代码,这将有所帮助。 – LeopardShark

+0

我不是很傻>我找到了原因。我玩其他音乐,当pygame弹这个声音时,声音也在播放.Pygame不能播放两个声音。所以第二个声音播放失败。谢谢最后问一下幼稚的问题。 – Inteyerry