Added support for different voices, renamed language and quote files with their 2 letter abreviations.

New arguments: -v, -c
This commit is contained in:
deadvey
2026-03-30 15:11:54 +01:00
parent 21345481b4
commit c59e00cf78
10 changed files with 1144 additions and 11 deletions

View File

@@ -1,12 +1,14 @@
import os
import json
def handle_arguments(arguments, config):
def handle_arguments(arguments, config, engine):
for index, arg in enumerate(arguments[1:]):
match arg:
case '--wpm'|'-w':
config['wpm'] = int(arguments[index+2])
case '--language'|'-l':
config['language'] = arguments[index+2]
case '--voice'|'-v':
config['voice'] = arguments[index+2]
case '--mode'|'-m':
config['mode'] = arguments[index+2]
case '--words'|'-o':
@@ -28,6 +30,11 @@ def handle_arguments(arguments, config):
for index,quote in enumerate(quotes):
print(f'{index}: {quote['quote']} - {quote['author']}')
exit()
case '--list-voices'|'-c':
voices = engine.getProperty('voices')
for voice in voices:
print(voice)
exit()
case _:
continue
return config