JarodMica / audiobook_maker

GNU General Public License v3.0
203 stars 34 forks source link

Line Breaks in text/audio Audiobook-Maker GUI display do not always conform to line breaks from source .txt file #5

Closed Artholos closed 11 months ago

Artholos commented 11 months ago

There are two behaviors in this issue:

  1. The program often omits line breaks from source .txt file, which causes multiple sentences to be rendered in one line. This has the consequence of causing unwanted regeneration for some sentences and increased time to regenerate the line.

  2. The program injects line breaks that were not present in the source file, typically after punctuation marks.

Here are some example scenarios I've encountered that have caused trouble for me:

In order for Tortoise to read acronyms correctly, Tortoise needs them to be written "A.B.C." to read out the phonetic title of the characters. If an acronym is written "ABC", there's a high probability Tortoise will read it like 'ahbkha' instead of 'ay-bee-see'. Unfortunately Audiobook Maker often interprets the final period and space characters in the acronym a line break and separates the sentence into two audio renders. This has the consequence of creating sentences that have the wrong inflection and intonations when listening to the audio file un-interrupted.

In addition, very long sentences with many appositives are best to generate in multiple lines so that if one appositive portion of the sentence had a poor render, the entire sentence does not need to be regenerated. Audiobook Maker however does not recognize line breaks after commas, and will concatenate lines together if the line above was ultimately punctuated with a comma.

JarodMica commented 11 months ago

Would you be able to post some example sentences for the desired result to be sent over to tortoise?

Currently there's a function that handles the passing and I would need to adjust some things there. It converts new lines to spaces and then makes sure that the minimum length of a "chunk" sent to tortoise is at least 130 characters meaning 2 sentences could be sent if they're too short.

May be able to add some additional "advanced" settings to change the behavior of the functions or adjust it entirely

Artholos commented 11 months ago

image image

Artholos commented 11 months ago

This text file had the sentences concatenated into 2 audio renderings.

Artholos commented 11 months ago

Oops I accidentally closed the issue. hehe sorry

JarodMica commented 11 months ago

Resolved here: https://github.com/JarodMica/audiobook_maker/commit/9080f9bf967c77a355fdff184c81f22c1af12314

Let me know if you run into anything else :)!