Python Forum
GUIZERO andnfrom threading import Thread import pyttsx3 engine = pyttsx3.inithreading
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GUIZERO andnfrom threading import Thread import pyttsx3 engine = pyttsx3.inithreading
#1
from threading import Thread
import pyttsx3
engine = pyttsx3.init()
from guizero import App, TextBox, PushButton, Text, alerts,Slider
from tkinter.font import Font

def voice_speed(slider_value):
    r=slider_value
    print(r)

def voice_volume(slider_value):
    v=slider_value
    print(v)

def go():
    while True:
        #print(slider_r.value)
        print(slider_v.value)
        engine.setProperty('rate',slider_r.value)
        engine.setProperty('volume',slider_v.value)
        engine.say(textbox.value)
        engine.runAndWait()

app = App()
slider_r = Slider(app, command=voice_speed)
slider_v = Slider(app, command=voice_volume)

text = Text(app, text="Enter your name")
textbox = TextBox(app)
button = PushButton(app, text="Start", command=go)
app.display()
I am trying to create a simple GUI app to convert text to speech. I don't have clear knowledge on parallel programming or threading in pythonn. So please help me to achieve my goal.
Here i want to start and stop voice play by pressing a push button and vary the volume and word rate by scroll bar.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] [Solved] Help with an DLL import error Extra 4 9,813 Mar-13-2023, 02:51 AM
Last Post: victorable
Lightbulb [Tkinter] Tkinter Class Import Module Issue AaronCatolico1 6 2,970 Sep-06-2022, 03:37 PM
Last Post: AaronCatolico1
  confusion using the import statement barryjo 4 1,515 Jan-26-2022, 07:10 PM
Last Post: barryjo
  Stop import from executing function, but allow the function to execute from tk btn. MrBitPythoner 4 2,624 Dec-08-2020, 10:00 PM
Last Post: MrBitPythoner
  [Tkinter] Noob question:Using pyttsx3 with tkinter causes program to stop and close, any ideas? Osman_P 4 5,232 Nov-14-2020, 10:51 AM
Last Post: Osman_P
  Example of guizero ListBox jreebel 1 2,236 Oct-29-2020, 08:17 PM
Last Post: Larz60+
  How to import entire module ? tonycstech 5 3,254 Oct-21-2020, 06:16 AM
Last Post: tonycstech
  guizero repeat command pdihawk 2 2,906 Sep-28-2020, 01:32 PM
Last Post: pdihawk
  how do i compile from pyjet import without a compile error? space_cat 0 1,268 Sep-22-2020, 01:57 PM
Last Post: space_cat
  Import a file and show file name on qcombobox GMCobraz 1 1,924 Jul-02-2020, 01:38 PM
Last Post: GMCobraz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020