Pygame混音器系统未初始化

2024-04-20 04:32:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在为我的社会研究课制作一个Pygame,我想给这个现有的游戏添加新的元素。问题是,当我加载旧游戏时,没有做任何重大的更改,我得到了一个错误。它似乎也有一些警告,我已经查过了,但大部分的线索都是多年前的。我的错误如下:

Jordans-MacBook-Air:SS-Game Jordanxxi$ python ocean_cleaner.py
2017-05-26 12:23:15.729 Python[61184:1392206] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
May 26 12:23:15  Python[61184] <Error>: The function ‘SLSFlushWindow’ is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. Please use `SLSFlushWindowContentRegion' instead.
Traceback (most recent call last):
  File "ocean_cleaner.py", line 30, in <module>
    hit = pygame.mixer.Sound("resources/audio/pop.wav")
pygame.error: mixer system not initialized

截至目前,我的代码如下:

^{pr2}$

有什么帮助吗?提前谢谢。在

更新-我是通过终端运行游戏而不是空闲。我仍然得到一个错误,但它有点不同。有人知道怎么解决这个问题吗?在

Traceback (most recent call last):
  File "/Users/Jordanxxi/Desktop/Game/ocean_cleaner.py", line 29, in <module>
    hit = pygame.mixer.Sound("resources/audio/pop.wav")
error: mixer system not initialized

Tags: orandinpygame游戏applicationis