From a628de8018d9ae201079af09ce33d95cd87adadf Mon Sep 17 00:00:00 2001 From: Benjamin Congdon Date: Sun, 19 May 2024 09:04:22 -0700 Subject: [PATCH] Only include char count of selected chapters --- audiobook_generator/core/audiobook_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audiobook_generator/core/audiobook_generator.py b/audiobook_generator/core/audiobook_generator.py index 80f3207..355ebae 100644 --- a/audiobook_generator/core/audiobook_generator.py +++ b/audiobook_generator/core/audiobook_generator.py @@ -63,8 +63,8 @@ def run(self): logger.info(f"Converting chapters from {self.config.chapter_start} to {self.config.chapter_end}.") # Initialize total_characters to 0 - total_characters = get_total_chars(chapters) - logger.info(f"✨ Total characters in selected book: {total_characters} ✨") + total_characters = get_total_chars(chapters[self.config.chapter_start - 1:self.config.chapter_end]) + logger.info(f"✨ Total characters in selected book chapters: {total_characters} ✨") rough_price = tts_provider.estimate_cost(total_characters) print(f"Estimate book voiceover would cost you roughly: ${rough_price:.2f}\n")