Added file mode support
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"mode": "quote",
|
||||
"mode": "words",
|
||||
"mode_modifier": 30,
|
||||
"wpm": 50,
|
||||
"language": "english"
|
||||
}
|
||||
|
||||
10
dictate.py
10
dictate.py
@@ -59,3 +59,13 @@ def quote(config):
|
||||
engine.runAndWait()
|
||||
time.sleep(1/(config['wpm']/60))
|
||||
|
||||
def file(config):
|
||||
engine = pyttsx3.init()
|
||||
with open(f'{config['mode_modifier']}', 'r') as file:
|
||||
lines = file.readlines()
|
||||
for line in lines:
|
||||
for word in line.split(' '):
|
||||
print(word,end=' ')
|
||||
engine.say(word)
|
||||
engine.runAndWait()
|
||||
time.sleep(1/(config['wpm']/60))
|
||||
|
||||
Reference in New Issue
Block a user