【发布时间】:2021-06-07 20:14:06
【问题描述】:
我一直在尝试进入 pygame,我想播放声音。我尝试像这样启动混音器模块:
import pygame
import time
pygame.init()
pygame.mixer.init()
当我运行它时,它给出了这个错误:
Traceback (moce recent call last):
File "main.py", line 5 in <module>
pygame.mixer.init()
pygame.error: ALSA: Couldn't open audio device: No such file or directory
我在 repl.it 上运行代码,但我不确定它是否是 repl 的问题,因为它导致在默认 IDLE 上完美运行的代码出现问题。
【问题讨论】: