Closed AriaShishegaran closed 6 months ago
Thanks for finding this. Looks like it's finding a sentence that has nothing but a period in it, which gives edge-tts nothing to actually speak. I'll figure out how that is slipping through, it should have been caught and ignored.
OK this is fixed in the PR I'm about to merge (tested with a snippet of your sample). Thanks for catching this!
I am having this same error but the sentence is a full one The command I am using is: .local/bin/epub2tts-edge --cover Timeline.png Timeline.txt and it errors out with Attempt 1/3 failed with '“With the Abbot gone, I sought him out.' in run_edgespeak with error: local variable 'e' referenced before assignment Attempt 2/3 failed with '“With the Abbot gone, I sought him out.' in run_edgespeak with error: local variable 'e' referenced before assignment Attempt 3/3 failed with '“With the Abbot gone, I sought him out.' in run_edgespeak with error: local variable 'e' referenced before assignment Giving up on sentence '“With the Abbot gone, I sought him out.' after 3 attempts in run_edgespeak.
That's odd, it could be transient (like a temporary network issue)? Could you try running the command again (it should pick up where it left off) and let me know if it still fails? If so, maybe you can share Timeline.txt with me (doc@aedo.net) so I can try to reproduce this and see what's going on.
Thanks for sharing your source material, I see at least one problem, and it will probably expose some other issues. On big one is that there are multiple chapters with no title (in the text file it's a line with just "#"). These SHOULD have been exported with "Part 6" or "Part 7" I think, so something is wrong with the export function.
Also during the book reading phase, there's no logic to handle a blank chapter name gracefully, so instead it just tries to speak ''.
However, that doesn't explain why you're seeing an error where it is trying multiple times to say a sentence that actually exists... So haha lots of things to look into here!
I think the poorly named branch "skip-empty-sentences" has the fix. I'm running a full book right now to confirm. I'll merge to main when it finishes.
The only thing I could reproduce here is chapter breaks with no title, ie
#
This is a chapter.
#
This is the next chapter
Now if the source txt has chapter breaks with no text in them, that chapter is titled "blank". I'll keep thinking about it in the back of my mind and probably come up with a more elegant approach to handling blank chapters like this but for now, it's the best I've got. Part of the reason is that I insert that as a sentence at the beginning of each chapter, and there are some things that just expect that "sntnc0.mp3" to exist... Also the metadata creation might choke on blank chapters too.
Believe this is fixed with the latest release, but @dawaffleman123 please test when you can and let me know if you're still having the same issue.
I'm getting a similar error here:
Attempt 1/3 failed with 'As it changes, so too does the definition of crime.' in run_edgespeak with error: local variable 'e' referenced before assignment
I removed the space after the period and so far the script runs normally
Believe this is fixed with the latest release, but @dawaffleman123 please test when you can and let me know if you're still having the same issue.
Ill run it through a couple of books in a couple hours and ill let you know how they come out.
I went through and processed 2 books the first one worked just fine, but then I got the same error on Timeline at the sentence. With the Abbot gone, I sought him out. I also tried this book in the regular epub2tts and it also did not work. Let me know if you need more info, I am happy to help.
I removed the space after the period and so far the script runs normally
I tried this too and it worked.
This is a new book I'm testing the script with and it returns this, I've also added the book I'm using for you to be able to test further.
The command I'm entering:
epub2tts-edge --speaker en-CA-LiamNeural Harvard\ Business\ Review\ -\ Generative\ AI\ _\ Generative\ AI_\ The\ Insights\ You\ Need\ from\ Harvard\ Business\ Review-Harvard\ Business\ Review\ Press\ \(2024\).txt
Harvard Business Review - Generative AI Generative AI The Insights You Need from Harvard Business Review-Harvard Business Review Press (2024).txt