From 56b336a52984572895bfb975290b56050b2a38b8 Mon Sep 17 00:00:00 2001 From: Juraj Borza Date: Fri, 2 May 2025 18:28:17 +0200 Subject: [PATCH 1/4] Added 'pip install build' to development instructions, otherwise python -m build won't work --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4ee7998..4620a25 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ If you'd like to modify the code and contribute to development, you can [downloa ```bash # Go to the directory where you extracted the repository and run: pip install -e . # Installs the package in editable mode +pip install build # Install the build package python -m build # Builds the package in dist folder (optional) abogen # Opens the GUI ``` From 0d86d107e9c402b7c261f60510dc98b7a2a4f9c0 Mon Sep 17 00:00:00 2001 From: Juraj Borza Date: Fri, 2 May 2025 18:50:33 +0200 Subject: [PATCH 2/4] remove the animation from preview button on cleanup --- abogen/gui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/abogen/gui.py b/abogen/gui.py index 3f7ceec..1b980bc 100644 --- a/abogen/gui.py +++ b/abogen/gui.py @@ -1545,7 +1545,11 @@ class abogen(QWidget): def _preview_cleanup(self): self.preview_playing = False - self.btn_preview.setIcon(self.play_icon) + try: + self.loading_movie.frameChanged.disconnect() + except Exception: + pass # Ignore error if not connected + self.btn_preview.setIcon(self.play_icon) self.btn_preview.setToolTip("Preview selected voice") self.btn_preview.setEnabled(True) self.voice_combo.setEnabled(True) From 036eed31421dd42b2abb517f14de0c4bd955d4f1 Mon Sep 17 00:00:00 2001 From: Juraj Borza Date: Fri, 2 May 2025 18:58:38 +0200 Subject: [PATCH 3/4] also stopping the loading movie on preview cleanup --- abogen/gui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/abogen/gui.py b/abogen/gui.py index 1b980bc..3ab1a3c 100644 --- a/abogen/gui.py +++ b/abogen/gui.py @@ -1545,6 +1545,7 @@ class abogen(QWidget): def _preview_cleanup(self): self.preview_playing = False + self.loading_movie.stop() try: self.loading_movie.frameChanged.disconnect() except Exception: From e7d479d8466db9709dfb5216a5132891986dd3bb Mon Sep 17 00:00:00 2001 From: Juraj Borza Date: Fri, 2 May 2025 19:00:01 +0200 Subject: [PATCH 4/4] use CPU conversion if GPU conversion is not available also in preview --- abogen/gui.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/abogen/gui.py b/abogen/gui.py index 3ab1a3c..5288a3d 100644 --- a/abogen/gui.py +++ b/abogen/gui.py @@ -1480,8 +1480,11 @@ class abogen(QWidget): lang = self.selected_voice[0] voice = self.selected_voice + # use same gpu/cpu logic as in conversion + gpu_msg, gpu_ok = get_gpu_acceleration(self.use_gpu) + self.preview_thread = VoicePreviewThread( - np_module, kpipeline_class, lang, voice, speed, self.use_gpu + np_module, kpipeline_class, lang, voice, speed, gpu_ok ) self.preview_thread.finished.connect(self._play_preview_audio) self.preview_thread.error.connect(self._preview_error)