diff --git a/tts.py b/tts.py index 4a0bdde..831903b 100644 --- a/tts.py +++ b/tts.py @@ -1,4 +1,3 @@ - """ Text-to-speech synthesis (TTS) @@ -36,8 +35,8 @@ def main(): sentences = [] # Read input file - with open(args['input'], "r", encoding="utf-8") as f: - lines = f.readlines() + with open(args['input'], "r", encoding="utf-8") as file: + lines = file.readlines() # Convert to sentences for line in lines: @@ -67,8 +66,8 @@ def main(): line = line.replace("?", "?. ") line = line.replace("(", ". ") - for x in line.split(". "): - sentences.append(x.strip()) + for sentence in line.split(". "): + sentences.append(sentence.strip()) sentences.append("") # Synthesis text