I figured out how to simulate typing using:
hello_world = 'Hello World, I am typing'
import os
import time
import sys
for letter in hello_world:
sys.stdout.write(letter)
sys.stdout.flush()
time.sleep(0.1)
And I also figured out how to do text to speech using pyttsx3
import os
import pyttsx3
engine =pyttsx3.init()
hello_speech = 'Hello World, I am typing'
engine.say(hello_speech)
engine.runAndWait()
I was thinking of putting the text-to-speech into a for loop so that it would say each word one by one using .splt() to iterate each one. I want python to say the text that it is typing out simultaneously.
Basically, I want it to be like the computer from War Games: https://www.youtube.com/watch?v=KXzNo0vR_dU at 0:25 in the clip