Problems with SoundInterval

I’m having a problem replaying a SoundInterval. I cut the Interval off early by calling Interval.finish(). When I opt to replay the sound, I have tried to call either Interval. start() or Interval.resume(). Now, when I try and play the sound again, Panda crashes in both instances. Do I have to do anything special to set up the Sound Interval again for replay?
The code is for a Dialogue tree system. Once I exit the dialogue, and go back to speaking back to the NPC again, it crashes on replaying the sound.

Here’s my code for the tree traversal and SoundInterval.

def dialogueTraversal(self,TraversalList,node):
if(node[1]):
self.exitDialogue()
elif(len(node[2]) > 0):
self.planeTalkBar.setTexture(self.planeTexTalkBar[1],1)

        #NPCspeech has a string for NPC dialogue
        NPCspeech = node[0]
        print "NPC" , NPCspeech
        NPCspeech = NPCspeech.encode('ascii')
        self.talkTextNPC['text'] = NPCspeech
        self.talkTextNPC.component('text0').setWordwrap(15.0)
        self.talkTextNPC.show()

        #PClist will have a list of all the PC dialogue strings to display
        self.PClist=node[2].keys()
        print "PC",self.PClist
        PCspeech = '\n'.join(self.PClist)
        PCspeech = PCspeech.encode('ascii')
        self.talkTextPC['text'] = PCspeech
        self.talkTextPC.show()
        
        self.NPCVoiceInt = SoundInterval(node[3], volume=1)
        self.NPCVoiceInt.start()
            
        self.PClistLength = len(self.PClist)
        #select which dialogue
        self.choiceIndex = 0;
        self.selectedString = self.PClist[self.choiceIndex]
        self.currentNode=node
        self.TraversalList = TraversalList
    else:
        parent = TraversalList.pop()
        parent[0]=self.selectedNode[0]
        self.dialogueTraversal(TraversalList,parent)

def dialogueChoice(self):
self.talkTextNPC.hide()
self.talkTextPC.hide()
self.NPCVoiceInt.finish()
self.TraversalList.append(self.currentNode)
self.selectedNode = self.currentNode[2][self.selectedString]
del self.currentNode[2][self.selectedString]
self.dialogueTraversal(self.TraversalList,self.selectedNode)

I suspect there’s a bug in the fmod glue code. That’s one of the less reliable modules, at present. We’ve had problems with it before.

I’m afraid that the guy who’s familiar with that module won’t be in the office until Monday, but I can have him analyze the problem then. My suggestion would be to suppress the sound until we have time to figure out the problem on Monday. My apologies for the delay.

By the way - even if there is some sort of mistake in your code, panda shouldn’t crash. It should print out an informative error message and continue. So this definitely is a bug in panda.

  • Josh

It would be awesome if you could email me a small program that triggers the bug. jyelon@andrew.cmu.edu

Problem fixed. Sounds don’t like to be copied in Panda.