Coders Packet

Talking Clock using Python

By Sheshagiri Kulkarni

This Program produces an audio output of current system time using the pyttsx3 module in Python

Following Python program reads system's current time using "time" module 

then time is converted to string format in order to get audio output by pyttsx3 module

pyttsx3 :

pyttxs3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline and is compatible with both Python 2 and 3.

Usage :

import pyttsx3

engine = pyttsx3.init()

engine.say("text to be converted to audio output")

engine.runAndWait()

in the program,

3 dictionaries are defined based on hours, minutes, and tens value

system's time is read and converted to a string value then compared to the corresponding dictionary values and output of time in words is produced

the text output is turned into audio output (as shown above in the usage section)

Download Complete Code

Comments

No comments yet