PANDA3D:声音错误

时间:2014-02-24 02:41:39

标签: python panda3d

我似乎无法执行mon Main.py,因为它给了我这个错误:

Traceback (most recent call last):
  File "main.py", line 383, in <module>
    gamebase = GameBase()
  File "main.py", line 278, in __init__
    DGG.setDefaultRolloverSound(self.sounds['GUI_rollover'])
KeyError: 'GUI_rollover'
:TaskManager: TaskManager.destroy()

(当然,它与声音有关......和dict有关,但我似乎无法弄清楚问题出在哪里)

发生错误的部分就在这里:

       exts = ('mp3','wav','ogg')
            for x in (3,3.5,5,0):
                for ext in exts:
                    for s in ToonGlobber.glob("phase_"+str(x)+"/audio/sfx/GUI_*."+ext,"phase_"+str(x)+"/audio/sfx"):
                sf = s.split('/')[-1].split('.')[0]
                self.sounds[sf] = loader.loadSfx(s)

    DGG.setDefaultRolloverSound(self.sounds['GUI_rollover'])
    DGG.setDefaultClickSound(self.sounds['GUI_click'])

    self.pickerNode = CollisionNode('mouseRay')
    self.pickerNP = camera.attachNewNode(self.pickerNode)
    self.pickerNode.setIntoCollideMask(BitMask32.allOff())
    self.pickerNode.setFromCollideMask(BitMask32(16))
    self.pickerRay = CollisionRay()
    self.pickerNode.addSolid(self.pickerRay)

造成这种情况的原因是什么?可以做些什么来解决它?

1 个答案:

答案 0 :(得分:0)

找不到指定的声音文件,大概是因为没有正确安装相位MF或者没有包含给定的GUI声音。