# Setup the controllers mouthController = MouthController(busInterface) eyesController = EyesController(busInterface) audioPlayer = AudioPlayer(mouthController) print "Controllers configured" # Set initial states mouthController.closeMouth() eyesController.openEyes() sleep(0.5) mouthController.holdMouth() eyesController.holdEyes() print "Initial facial states set" # Analyze file result = audioPlayer.analyze(wavFile) mouthController.setChunkAnalysisData(result) print "Wav file analysis complete" # Start the controller threads mouthController.startControlThread() print "Mouth controller started" eyesController.startControlThread() print "Eye controller started" # Play the audio audioPlayer.play(wavFile) # Terminate everything and wait for completion mouthController.terminateControlThread() eyesController.terminateControlThread()