Sound doesn't play from director functions
Hello, when running a sample script like this one:
Code:
import viz Code:
Code:
import viz |
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 |
If it takes a while to add the sound, would there be a frame rate blip on the add?
What if you added a 3D model with this method? |
If the audio takes a while to load, then adding the file during runtime will cause a stall in the framerate. In this case, you would use the modified version of the director function I posted above. This is not the case for 3D models though, they can be added as usual in director functions. The call to pythoncom.CoInitialize() is only necessary for COM/DirectX related objects.
|
Thanks farshizzo, very helpful as usual. Works flawlessly now. :)
|
All times are GMT -7. The time now is 07:19 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC