View Single Post
  #2  
Old 07-29-2008, 09:59 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You need to add the sound object in the main thread. Once it is added you should be able to play it in other director threads.

If it is necessary for you to add the sound object in the director thread, then you can install the pywin32 library for python and use the following code:
Code:
import viz
import pythoncom
viz.go()

def playSound():

	pythoncom.CoInitialize() #Initialize COM

	sound = viz.addAudio("quack.wav")
	sound.play()

	pythoncom.CoUninitialize() #Uninitialize COM

	return
	
viz.director(playSound)
Reply With Quote