Merge branch 'denizsafak:main' into main

This commit is contained in:
Juraj Borza
2025-05-03 19:27:33 +02:00
committed by GitHub
6 changed files with 44 additions and 15 deletions
+1 -6
View File
@@ -1,6 +1 @@
- Merge pull request [#7](https://github.com/denizsafak/abogen/pull/7) by [@jborza](https://github.com/jborza) that improves voice preview and documentation. - Better approach for detemining the correct configuration folder for Linux and MacOS, using platformdirs.
- Fixed the issue when a voice is selected, the voice mixer tries to pre-select that voice and ignores existing profiles.
- Fixed the error while renaming the default "New profile" in the voice mixer.
- Fixed subtitle_combo enabling/disabling when a voice in the voice mixer is selected.
- Prevented using special characters in the profile name to avoid conflicts.
- Improved invalid profile handling in the voice mixer.
+25 -1
View File
@@ -90,7 +90,7 @@ Heres Abogen in action: in this demo, it processes 3,000 characters of tex
- **Chapter Control**: Select specific `chapters` from ePUBs or `chapters + pages` from PDFs. - **Chapter Control**: Select specific `chapters` from ePUBs or `chapters + pages` from PDFs.
- **Options**: - **Options**:
- **Replace single newlines with spaces**: Replaces single newlines with spaces in the text. This is useful for texts that have imaginary line breaks. - **Replace single newlines with spaces**: Replaces single newlines with spaces in the text. This is useful for texts that have imaginary line breaks.
- **Configure max words per subtitle**: Automatically configures the maximum number of words per subtitle entry. - **Configure max words per subtitle**: Configures the maximum number of words per subtitle entry.
- **Create desktop shortcut**: Creates a shortcut on your desktop for easy access. - **Create desktop shortcut**: Creates a shortcut on your desktop for easy access.
- **Open config.json directory**: Opens the directory where the configuration file is stored. - **Open config.json directory**: Opens the directory where the configuration file is stored.
- **Open temp directory**: Opens the temporary directory where converted text files are stored. - **Open temp directory**: Opens the temporary directory where converted text files are stored.
@@ -103,6 +103,30 @@ Heres Abogen in action: in this demo, it processes 3,000 characters of tex
With voice mixer, you can create custom voices by mixing different voice models. You can adjust the weight of each voice and save your custom voice as a profile for future use. The voice mixer allows you to create unique and personalized voices. (Huge thanks to [@jborza](https://github.com/jborza) for making this possible through his contributions in [#5](https://github.com/denizsafak/abogen/pull/5)) With voice mixer, you can create custom voices by mixing different voice models. You can adjust the weight of each voice and save your custom voice as a profile for future use. The voice mixer allows you to create unique and personalized voices. (Huge thanks to [@jborza](https://github.com/jborza) for making this possible through his contributions in [#5](https://github.com/denizsafak/abogen/pull/5))
## `About Chapter Markers`
When you process ePUB or PDF files, abogen converts them into text files stored in your temporary directory. When you click "Edit," you're actually modifying these converted text files. In these text files, you'll notice tags that look like this:
```
<CHAPTER_MARKER:Chapter Title>
```
These are chapter markers. They are automatically added when you process ePUB or PDF files, based on the chapters you select. They serve an important purpose:
- Allow you to split the text into separate audio files for each chapter
- Save time by letting you reprocess only specific chapters if errors occur, rather than the entire file
You can manually add these markers to plain text files for the same benefits. Simply include them in your text like this:
```
<CHAPTER_MARKER:Introduction>
This is the beginning of my text...
<CHAPTER_MARKER:Main Content>
Here's another part...
```
When you process the text file, abogen will detect these markers automatically and ask if you want to save each chapter separately and create a merged version.
![Abogen Chapter Marker](https://raw.githubusercontent.com/denizsafak/abogen/refs/heads/main/demo/chapter_marker.png)
## `Supported Languages` ## `Supported Languages`
``` ```
# 🇺🇸 'a' => American English, 🇬🇧 'b' => British English # 🇺🇸 'a' => American English, 🇬🇧 'b' => British English
+13 -2
View File
@@ -1417,7 +1417,6 @@ class abogen(QWidget):
if self.preview_playing: if self.preview_playing:
try: try:
import pygame import pygame
pygame.mixer.music.stop() pygame.mixer.music.stop()
except Exception: except Exception:
pass pass
@@ -1432,7 +1431,19 @@ class abogen(QWidget):
self.voice_combo.setEnabled(False) self.voice_combo.setEnabled(False)
self.btn_voice_formula_mixer.setEnabled(False) # Disable mixer button self.btn_voice_formula_mixer.setEnabled(False) # Disable mixer button
self.btn_start.setEnabled(False) # Disable start button during preview self.btn_start.setEnabled(False) # Disable start button during preview
# start loading animation
# Start loading animation - ensure signal connection is always active
if hasattr(self, 'loading_movie'):
# Disconnect previous connections to avoid multiple connections
try:
self.loading_movie.frameChanged.disconnect()
except TypeError:
pass # Ignore error if not connected
# Reconnect the signal
self.loading_movie.frameChanged.connect(
lambda: self.btn_preview.setIcon(QIcon(self.loading_movie.currentPixmap()))
)
self.loading_movie.start() self.loading_movie.start()
def pipeline_loaded_callback(np_module, kpipeline_class, error): def pipeline_loaded_callback(np_module, kpipeline_class, error):
+3 -4
View File
@@ -66,10 +66,9 @@ def get_version():
# Define config path # Define config path
def get_user_config_path(): def get_user_config_path():
if os.name == "nt": from platformdirs import user_config_dir
config_dir = os.path.join(os.environ["APPDATA"], "abogen") # Use platformdirs to get the user configuration directory
else: config_dir = user_config_dir("abogen", appauthor=False, roaming=True)
config_dir = os.path.join(os.path.expanduser("~"), ".config", "abogen")
os.makedirs(config_dir, exist_ok=True) os.makedirs(config_dir, exist_ok=True)
return os.path.join(config_dir, "config.json") return os.path.join(config_dir, "config.json")
+1 -1
View File
@@ -1,6 +1,6 @@
import os import os
import json import json
from utils import get_user_config_path, get_resource_path from utils import get_user_config_path
def _get_profiles_path(): def _get_profiles_path():
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB