Can we use âsubprocess.call()â in the BGE?
how about âsubprocess.Popen()â ?
would those even help?
This would be awesome to get running smooth with blender.
Just think!, rather than having hundreds of megabytes of speech sound files for an RPG game, you could have just simple text scripts for the TTS system to recite for the NPCâs dialogs, and for narrating parts of the story .
Blenderâs implementation of Python doesnât support multi-threading, which would get round this issue and also allow you to use more than one CPU with a Python script.
Maybe what you can try is executing a Python script using os.system and in that script use Python threading. Not entirely sure if that would work or how youâd get the data back from the thread though.
import os
import thread
class Speech:
def __init__(self):
thread.start_new_thread(self.talk,())
def talk(self):
os.system("espeak -f scriptname.txt")
And then in blender have a script that goes
import talker
talker.Speech()
And that is a way to get threading in blender is by importing something and having that run the thread, because blenders thing cannot run the thread or start the thread it all has to be in another script
ashsid method is still working
however if you have spaces in your path it will fail to open
use this if needed (path_file_to_open contains spaces in it)