在 RaspberryPi3 B+ 模型上进行测试,只有 2 行 py 代码。Python 版本 3.5.3
from playsound import playsound
playsound("alarm.wav")
即使在 Thonny IDE 上安装软件包gst-make
、、和后gstreamer-player
,我也会收到以下错误。不确定还需要什么。是否有用于发出声音的替代包?fisspy
pgi
Traceback (most recent call last):
File "sound.py", line 3, in <module>
playsound("home/pi/alarm.wav")
File "/home/pi/.local/lib/python3.5/site-packages/playsound.py", line 92, in _playsoundNix
gi.require_version('Gst', '1.0')
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 118, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available