Closed AriaShishegaran closed 5 months ago
I think this is the result of an "empty" paragraph being created. I saw this when I had a text file that had " *" between sections of the book, which would cause the script to send that to edgeTTS to be read, but then there's nothing to actually read, so it just skips it. Later on though, the script is looking for that specific paragraph, and there's nothing to be found.
I would appreciate it if you could take a look at your source text and see if you notice anything like that. If you do find that, try deleting those instances (paragraph breaks with no text) from the txt file, and run again to see if that was the issue. Let me know, and I'll try to detect empty paragraphs like that during ingest and skip them entirely.
This might be the same as https://github.com/aedocw/epub2tts-edge/issues/2
Please do a git pull
and pip install . --upgrade
when you can. I've added something that should result in skipping past anything it can't read. This might address your issue.
Upon looking into this, it appears this is the same issue as I'm experiencing that I made note of in the ffmpeg on linux discussion. I've tried with the most recent version, and unfortunately it's not made any difference. Interestingly, the problematic file which is one of the paragraphs is 0 kB, so suspect it is indeed including empty paragraphs for some reason as you suspect. Would be interesting if the most recent commit solved this for the original poster, and if so I'm happy to discuss this in another issue.
I have some very clumsy try/except loops now in the handle-edge-failure branch. I haven't found any good way to actually simulate edge-tts sometimes failing to send back any data, so I don't really know if what I slapped together will work. But if it does, it should notice when an mp3 is zero bytes and try again (up to 3 times before giving up and exiting).
Latest merge to main catches when there's an empty sentence file, and tries again. In my tests I hit that a few times, and it always had something on the second try. This might fix this issue, please try git pull && pip install . --upgrade
to get the latest version, and try encoding the book again if you can, thanks!
@aedocw I can confirm that after upgrading the problem is gone. I tested it over the same version of book I was originally using when faced with the error above. It now functions correctly.
This also seems to have fixed the problem for me as well, thanks.
Excellent! Thank you @AriaShishegaran and @danielw97 for testing and letting me know, I appreciate the feedback!