31 lines
590 B
Python
31 lines
590 B
Python
import pyttsx3
|
|
import sys
|
|
import json
|
|
|
|
import args # Handles command line arguments
|
|
import maths
|
|
import dictate
|
|
|
|
engine = pyttsx3.init()
|
|
|
|
config = {}
|
|
with open('config.json', 'r') as file:
|
|
config = json.load(file)
|
|
|
|
# Handle the command line arguments
|
|
config = args.handle_arguments(sys.argv, config)
|
|
|
|
dictation = ''
|
|
|
|
engine.setProperty('rate', config['wpm'])
|
|
# TODO: match case
|
|
match config['mode']:
|
|
case 'words':
|
|
dictate.words(config, engine)
|
|
case 'timed':
|
|
dictate.timed(config, engine)
|
|
case 'quote':
|
|
dictate.quote(config, engine)
|
|
case 'file':
|
|
dictate.file(config, engine)
|