Python Forum
pyttsx3 cuts off when run from py file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyttsx3 cuts off when run from py file
#1
i'm using pyttsx3 on a raspberry pi running raspbian which is debian linux to read out the current time and date. this is a simple test of the module before i try implementing reading out a timer in a larger project but i'm already running into a curious issue. when i run the py file the voice is cut off partway through when it starts reading the minutes. the exact same lines copied into the interactive python shell run fine. I am running from bash and have no gui. why does it work one way but not the other? and how do i get it to read properly. the py file is below

import datetime
import pyttsx3
now=datetime.datetime.now()
datestring= "The Current time is " + str(now.hour) + " " +str(now.minute) + \
            " and " + str(now.second) + " seconds on " + str(now.month) + \
            " " + str(now.day) + " " + str(now.year)
engine=pyttsx3.init()
engine.setProperty('rate',100)
engine.setProperty('volume',1)
engine.say(datestring)
engine.runAndWait()
print(datestring)
Reply


Messages In This Thread
pyttsx3 cuts off when run from py file - by duelistjp - Dec-05-2018, 08:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Controlling text-to-speech pauses with pyttsx3 pmac1300 4 4,582 Mar-14-2022, 06:47 AM
Last Post: Coricoco_fr
  pyttsx3 cutting off last word Extra 3 2,985 Feb-28-2022, 11:20 PM
Last Post: BashBedlam
  pyttsx3 problem Tyrel 0 1,138 Feb-05-2022, 08:53 AM
Last Post: Tyrel
  Know when the pyttsx3 engine stops talking UsualCoder 3 3,288 Aug-29-2021, 11:08 PM
Last Post: snippsat
  working with pyttsx3 gr3yali3n 0 1,638 Nov-24-2020, 09:40 AM
Last Post: gr3yali3n

Forum Jump:

User Panel Messages

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