Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在使用一些简单的 winsound 代码时遇到了问题:
import winsound winsound.PlaySound("song.wav", winsound.SND_FILENAME)
问题是每当我尝试播放 .wav 文件时,我得到的只是 Windows 错误声音,然后程序继续前进。
我有一种感觉,这可能是因为文件太大,因为我以前用较短的 .wav 文件做过。有大小/长度限制吗?有谁知道界限吗?如果是这样,有没有办法解决这个问题?
我曾经也遇到过这个问题,但是当我将音频文件放在 Python 目录中时,它就起作用了。试试看。:)