2
$\begingroup$

I want to play 3 audio files in the Blender Game Engine.

  • Play File 1
  • Wait 3 seconds
  • Play File 2
  • Wait 4 seconds
  • Play File 3

If I use time.sleep the blender game window doesn't update. There is another problem: I can only play one file with device.play(file1) and aud. After that the script doesn't continue. I want to start the script when the program is started. How can I do that?

$\endgroup$

1 Answer 1

0
$\begingroup$

You can play multiple files with the same device, what you need are multiple factories and handles. Use a class, put the device as a global variable or as a class attribute and the handle and factory as instance attributes.

To knwo when the file ends check in a low frquency loop (Always sensor with skip > 10) if the status of the handle is false, if it is, it means that the file has ended and that you can play the next one.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .