p0n1 / epub_to_audiobook

EPUB to audiobook converter, optimized for Audiobookshelf
MIT License
1.05k stars 107 forks source link

Error while converting text to speech (attempt 1): ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read)) #8

Open estrellagus opened 11 months ago

estrellagus commented 11 months ago

Using on Mac (Sonoma - python 3.9.6) and able to run the enclosed example book without any issue. however, other epubs that I have gotten though the years do not work. All run but the message warning keep showing after several minutes as the attempt increase

I attached the full log. error.txt

p0n1 commented 11 months ago

Looks like network connection issue to me. Or maybe not working properly on your epub files. Could you find a book not working on https://www.gutenberg.org and give me its link?

estrellagus commented 11 months ago

I tested quite a few books from gutenberg and all work. I also tried a few known open source epub i had and all worked. The book i have is copyrighted so i tried another known copyrighted book and same error occurred. I then recreated all tests on a separate system running debian and same occurred.

So my conclusion is azure tts has logic yo identify copyrighted books and error out for anyone trying to use tts on that material.

So not a bug but suggest add description on readme as suspect others will run into same issue

A shame cant so do but will continue to follow in case in the future other tts added that have this limitation. I find coqui-ai/tts here in github very interesting and starting to check it out petsonally

p0n1 commented 11 months ago

@estrellagus Thanks for detailed trace. I don't think Azure could detect copyrighted books because we're just sending strings/paragraphs to it not the whole epub file. Maybe just some kind of encoding issue.

Very interested in this issue. Will keep this issue open.

alessdangelo commented 10 months ago

I got the same issue yesterday. I changed the language but didn't change the voice, it then worked when I did. Don't know if it's related tho. I'm on Mac M1 sonoma too.

p0n1 commented 10 months ago

I got the same issue yesterday. I changed the language but didn't change the voice, it then worked when I did. Don't know if it's related tho. I'm on Mac M1 sonoma too.

@alessdangelo Thanks for reporting. May I know what language and voice you used for working and not working cases?

estrellagus commented 10 months ago

I just downloaded the latest version and tried one audiobook that had issues with the openai backend and it worked fine. Itis great, only issue is the cost is super high. Over $20 for a single epub.

p0n1 commented 10 months ago

I just downloaded the latest version and tried one audiobook that had issues with the openai backend and it worked fine. Itis great, only issue is the cost is super high. Over $20 for a single epub.

@estrellagus Glad OpenAI API works for you. How many characters in your book. I read on twitter about the price difference of all kinds of TTS services. Looks like OpenAI price is very competitive. I think they could even lower their price soon just like their other services.

estrellagus commented 10 months ago

I just downloaded the latest version and tried one audiobook that had issues with the openai backend and it worked fine. Itis great, only issue is the cost is super high. Over $20 for a single epub.

@estrellagus Glad OpenAI API works for you. How many characters in your book. I read on twitter about the price difference of all kinds of TTS services. Looks like OpenAI price is very competitive. I think they could even lower their price soon just like their other services.

The book has physically 842 pages. The character count produced by running script with --preview is

"Total characters in selected chapters: 1387583 "