0
導入聲音
爲mySound = sound.load_sound( 「你好」)
,我得到這個錯誤
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more information.
>>> [evaluate A1.py]
Traceback (most recent call last):
File "C:\Program Files\Wing IDE 101 4.0\src\debug\tserver\_sandbox.py", line 3, in <module>
pass
File "C:\Python27\Lib\site-packages\pygraphics\sound.py", line 660, in load_sound
return Sound(filename=filename)
File "C:\Python27\Lib\site-packages\pygraphics\sound.py", line 225, in __init__
snd = load_pygame_sound(filename)
File "C:\Python27\Lib\site-packages\pygraphics\sound.py", line 540, in load_pygame_sound
raise Exception("This file does not exist.")
Exception: This file does not exist.
你是什麼意思由文件擴展名?和我嘗試sound.load_sound(C:\ Python27 \ Hello)的路徑,並給我一個錯誤 – user988696
那麼,你的歌曲位於哪裏?我的猜測是它在C:\ Python27 \ Hello中,或者它在C:\ Python27中,並且被稱爲Hello.wav。無論哪種方式,請確保您提供.wav文件的完整路徑。 – DMan