In this fifth video of creating a speech synthesis app in Python we learn about threading.
Threading allows us to separate or contain parts of the main app, a situation that needs special attention in graphical or GUI applications. Without threading, every time you'd click a button or run a function, the application would freeze or become unresponsive until the function completed. Obviously, we want to, maybe, deal with some other part of the application while it's doing something (running a function) hence we need responsiveness.
In this particular case, I contain or isolate the running of the 'Speaking' function of the application within a thread, so every time we click the 'Speak' button and Ivona starts speaking, the app does not freeze, or remains responsive. I guess you will understand better by watching the tutorial...
Previously in this series:
- Making a Voice Synthesis App with Ivona and Python - Part 1
- Making a Voice Synthesis App with Ivona and Python - Part 2
- Making a Voice Synthesis App with Ivona and Python - Part 3
- Making a Voice Synthesis App with Ivona and Python - Part 4