Closed erfansamandarian closed 4 months ago
It feels like a sin doing a PR for only two lines of code...
I like your approach, but I would suggest making the substitution later on, while doing the TTS rather than during the export. This way if someone is going straight from text, it will still catch/fix the issue, rather than relying on the multiple punctuation to be caught during export from epub to text.
You could basically move your two lines down to line 362 inside the async loop inside parallel_edgespeak. I think this would work:
async with semaphore:
loop = asyncio.get_running_loop()
sentence = re.sub(r'[!]+', '!', sentence)
sentence = re.sub(r'[?]+', '?', sentence)
task = loop.run_in_executor(executor, run_edgespeak, sentence, speaker, filename)
tasks.append(task)
Looks great, thanks!
Thank you!
Fix for https://github.com/aedocw/epub2tts-edge/issues/28