我正在尝试使用内置的winsound库将多个声音叠加在一起。我用
开始我的第一个声音winsound.PlaySound("test1.wav", winsound.SND_FILENAME | winsound.SND_ASYNC)
当我尝试开始我的其他声音时
winsound.PlaySound("test1.wav", winsound.SND_FILENAME | winsound.SND_ASYNC
| winsound.SND_NOSTOP)
我得到了非常具有描述性的RuntimeError: Can't play sound
我该如何解决这个问题?
答案 0 :(得分:1)
我可以使用winsound和playsound播放两种声音:
from playsound import playsound
import winsound
#
filename1 = "C:/Users/sound1.wav"
filename2 = "C:/Users/sound2.wav"
soundfile = filename1
winsound.PlaySound(soundfile, winsound.SND_FILENAME|winsound.SND_ASYNC)
playsound(filename2)