Commit Graph
100 Commits
Author SHA1 Message Date
Deniz Şafak ffac4a4da9 fix(subtitles): enable "N words" and karaoke modes in PyQt
Three related fixes:

- make_subtitle_writer: accept word-count modes ("N words") in
  create_subtitle_writer. SubtitleMode("5 words") raised ValueError,
  which make_subtitle_writer swallowed and returned None, so PyQt never
  created or wrote the subtitle file when an "N words" mode was selected.
  Unknown modes now fall back to SubtitleMode.SENTENCE (writers only
  branch on SENTENCE_HIGHLIGHT). Regression test added.

- gui.py: refresh subtitle combo item availability after initial
  voice/profile selection. update_subtitle_options_availability() ran
  during initUI with selected_lang=None for a profile, taking the
  non-English branch and disabling Highlighting/N-words items; the fix-up
  never re-ran because setCurrentIndex on an already-current index emits
  no signal. Now called once more after the profile/voice language is
  resolved.

- AssWriter: stop discarding per-word karaoke timing. _add_karaoke_tags
  unconditionally replaced entry text with uniform {\\k100} tags,
  destroying the real per-word {\\kf} timings from
  _process_karaoke_highlighting. Only synthesize simplified tags when the
  text has no karaoke tags. Regression test added.
2026-08-20 23:27:49 +03:00
Deniz Şafak 5432de7ac5 fix(segmentation): process TTS segments per sentence, fix all subtitle modes
Sentence modes processed all text as a whole: Pipeline.__call__ merged every
engine segment back into one (whole text, no per-token timings), producing a
single giant subtitle and whole-text progress logs.

- tts_plugin/types: add TokenTiming, AudioSegment, SynthesizedAudio.segments
- tts_plugin/utils: Pipeline yields one Segment per engine segment (with
  tokens); merged fallback only when engine provides none
- kokoro engine: expose per-segment graphemes/audio + per-word token timings
- supertonic engine: expose per-segment graphemes/audio (no tokens)
- split_pattern: English Sentence/Sentence+Comma engine split is newline-only
  (boundaries applied at subtitle time via spaCy); non-English Sentence+Comma
  with spaCy ON uses spaCy pre-segmentation + newline engine split (no
  commas); spaCy-off fallback keeps comma pattern
- tts_segments: restore inter-segment whitespace on real per-word token
  boundaries only (never FakeToken fallbacks)
- _to_language_enum: accept Language enum input (str(enum) is "Language.ES",
  silently resolved to EN_US and disabled spaCy pre-TTS for every language
  in WebUI)
- pyqt/conversion, utils: replace print with logging
- add AGENTS.md documenting the segmentation/subtitle contract for future
  sessions
- tests: update English split-pattern expectations (1566 passing)
2026-08-20 23:00:15 +03:00
Deniz Şafak 823f5be029 fix(pyqt): make app close fast and crash-free
Clicking the window close button froze the app: closeEvent ran the full
process cleanup (engine disposal, CUDA flush, subprocess termination) and
unbounded thread joins synchronously on the GUI thread before the window
could start closing, and a 3.5s delay came from flush_cuda importing
torch even when it was never loaded.

- closeEvent no longer runs cleanup synchronously; the aboutToQuit hook,
  which was never connected (registered before QApplication existed), now
  runs it after the window is gone
- bound thread waits in cleanup_conversion_thread/cleanup_preview_threads
  with a terminate() fallback so closing never hangs
- flush_cuda skips torch work when torch was never imported
- restore the default Qt message handler before sys.exit; the custom
  Python handler was invoked during interpreter teardown and caused a
  SIGSEGV after shutdown cleanups finished
- log and time the close sequence (closeEvent steps + each shutdown hook)
2026-08-20 22:00:08 +03:00
Deniz Şafak aaa6ac112b fix(audio_helpers): update opus bitrate to 128kbps in ffmpeg command 2026-08-20 21:32:07 +03:00
Deniz Şafak 11274ad6bf fix(pyqt): migrate GUI to Language enums, fix subtitle mode gating
Complete the Language enum unification (commit 0dc491e) for the PyQt
GUI, which was left resolving languages from kokoro letter codes
(voice[0]) while domain and WebUI already used Language enums.

- selected_lang is now always a Language enum: voices resolve via
  language_for_voice_id(), profiles via resolve_profile_language()
- kokoro letter->Language mapping stays in the engine (new public
  language_for_code()); the Language.from_code() domain shim is removed
- legacy profile files with letter codes ("a", "e", ...) are tolerated
  only at the profile read boundary; new profiles save ISO codes
- conversion.py letter comparisons replaced with enum comparisons, and
  SynthParams lang_code= -> language= (would TypeError at runtime)
- subtitle dropdown enabled for all languages; word-count and
  highlighting modes restricted to English with auto-switch to Sentence
- tests: engine mapping + profile language resolution added; 1566 pass
2026-08-20 21:28:30 +03:00
Deniz Şafak f340b976db feat: added colorful logging using rich, improved startup times by lazy-loading spacy, some other fixes 2026-08-20 20:52:08 +03:00
Deniz Şafak 9da15aefa4 Merge pull request #192 from Sanjays2402/fix/preserve-user-metadata
Preserve user-entered book metadata after extraction
2026-08-20 09:37:34 -07:00
Deniz Şafak 919aea9295 Merge pull request #199 from SimonFoobar648/fix/star-history-chart
Fix broken star history chart
2026-08-16 22:44:10 +03:00
Deniz Şafak 9201f58770 Add k0sm0naft to GitHub funding list 2026-07-23 16:27:54 +03:00
Deniz Şafak 6274a02d5e Fix empty voice list when launched via desktop shortcut
PluginManager.discover() used a relative path 'plugins', which resolved
against the CWD. When launched from a desktop shortcut the CWD is ~, so
the plugins directory was never found and no voices appeared in the list.

Fall back to the project-relative plugins path when the default relative
path doesn't resolve.
2026-07-23 03:55:07 +03:00
Deniz Şafak 342ea0dfac Fix spaCy unknown language error: map Kokoro single-letter codes to Language enum in get_spacy_model 2026-07-23 03:33:06 +03:00
Deniz Şafak 27f88b759d Fix spurious HF HEAD requests: return early on cache hit in tracked_hf_hub_download 2026-07-23 03:26:58 +03:00
Deniz Şafak dbcbb1c8a9 Fix NameError: add missing 'from pathlib import Path' in pyqt/conversion.py 2026-07-23 03:18:51 +03:00
Deniz Şafak bd99ee1ba1 fix: subtitle FakeToken split, missing run_tts_segment_loop import
- subtitle_generation: split multi-sentence FakeToken into separate entries
- conversion.py: add missing run_tts_segment_loop import

No changes to spacy_utils or Language enum.
2026-07-23 03:15:21 +03:00
Deniz Şafak d5cddb9749 fix: pass mock job object to merge_pronunciation_overrides instead of positional args 2026-07-23 02:33:18 +03:00
Deniz Şafak ec55918b04 fix: add load_single_voice to Pipeline wrapper to prevent formula string being used as download filename 2026-07-23 02:28:41 +03:00
Deniz Şafak 14913b45e9 fix: import importlib.util explicitly (not auto-loaded in Python 3.12) — broke plugin loading, causing empty voice lists 2026-07-23 02:17:46 +03:00
Deniz Şafak a0fdabd81f fix: suppress harmless Qt portal registration warning on Linux 2026-07-23 01:42:41 +03:00
Deniz Şafak 473631b84e fix: use theme-aware GREY_BACKGROUND for word substitutions instructions label 2026-07-23 01:41:13 +03:00
Deniz Şafak 0f5003dfdd fix: add missing imports for get_resource_path and load_integration_settings 2026-07-23 01:37:50 +03:00
Deniz Şafak fbb5d4e368 Merge pull request #179 from k0sm0naft/refactor/backend-registry
Add TTS backend registry and automatic backend registration
2026-07-06 15:14:47 +03:00
Deniz Şafak ab8cbc4911 Merge pull request #178 from k0sm0naft/refactor/backend-package
refactor: move backend implementations to tts_backends package
2026-07-06 14:50:16 +03:00
Deniz Şafak 5e2048072a Merge pull request #177 from k0sm0naft/refactor/tts-backend-interface
feat: Add TTSBackendMetadata model
2026-07-06 14:49:35 +03:00
Deniz Şafak 56d3e414b3 Merge pull request #176 from k0sm0naft/feat/voice-metadata
feat: add VoiceMetadata data model for TTS backends
2026-07-06 11:01:22 +03:00
Deniz Şafak b942bcb820 Merge pull request #175 from k0sm0naft/refactor/tts-backend-interface
refactor: Switch TTSBackend from ABC to Protocol
2026-07-06 11:00:46 +03:00
Deniz Şafak cbc05ead42 Merge pull request #173 from k0sm0naft/refactor/tts-backend-interface
refactor: introduce TTS backend abstraction
2026-07-03 21:04:47 +03:00
Deniz Şafak 9fa81fbe1e Merge pull request #160 from JoaGamo/main
Fix #152 : preview buttons on webUI
2026-04-30 13:05:44 +03:00
Deniz Şafak ca5c5ee62d Merge pull request #146 from olandir/131wVoiceTags
Voice Tags and Word Substitution Added to Main Script
2026-03-07 01:48:59 +03:00
Deniz Şafak 8322f7f416 Merge pull request #128 from vladimir-sol/fix-add-missing-pauses
Ensure appropriate speech pauses by adding newlines at epub processing
2026-02-19 14:57:06 +03:00
Deniz Şafak cc9c2a22ba Update GitHub Sponsors usernames in FUNDING.yml 2026-02-10 16:14:05 +03:00
Deniz Şafak d1366b445d Merge pull request #139 from abenea/crash
Fix importing chapters in the PyQt UI.
2026-02-08 17:51:56 +03:00
Deniz Şafak d30415ffe7 Update project version from 1.3.0 to 1.3.1. 2026-02-07 00:23:08 +03:00
Deniz Şafak 083f1eb09b Update CHANGELOG for version 1.3.0
Removed unreleased section and updated version 1.3.0 details.
2026-02-07 00:04:03 +03:00
Deniz Şafak 30929e8f4e Format pyproject.toml 2026-02-07 00:03:20 +03:00
Deniz Şafak ded73843c9 Merge pull request #136 from denizsafak/webui
Merge webui with main

Huge thanks to @jeremiahsb!!
2026-02-06 23:46:03 +03:00
Deniz ŞafakandCopilot 7b1f4f54ee Update README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-06 23:45:13 +03:00
Deniz ŞafakandCopilot 8cbfc15028 Update CHANGELOG.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-06 23:44:52 +03:00
Deniz Şafak 79957d09ed Fix c10.dll issue in installer script 2026-02-06 23:36:32 +03:00
Deniz Şafak 925ef51edc Add webui photo 2026-02-06 23:26:16 +03:00
Deniz Şafak be7c7baa75 Update readme 2026-02-06 23:20:04 +03:00
Deniz Şafak 6ab863e65f Update README and version 2026-02-06 23:09:49 +03:00
Deniz Şafak 950eb317f0 Fixed all pytest errors, enhanced book parser with context management and resource cleanup, update tests for proper parser closure 2026-01-10 00:09:04 +03:00
Deniz Şafak bd30939d27 Fix "span_text not defined" warning 2026-01-09 22:39:49 +03:00
Deniz Şafak ace1022da4 Merge pull request #126 from mohangk/webui
Further refactoring of book_handler logic into PDFParser
2026-01-09 20:50:33 +03:00
Deniz Şafak 5ae153f841 Reformat using black 2026-01-09 01:36:14 +03:00
Deniz Şafak 3c800df450 Performance improvements for voice mixer 2026-01-09 01:30:38 +03:00
Deniz Şafak fc0af420c6 Handle empty voice list initially 2026-01-09 01:19:39 +03:00
Deniz Şafak 7677f5a1e2 Update installation instructions in README to use editable mode for development 2026-01-08 01:30:43 +03:00
Deniz Şafak 0e726b97c4 Merge pull request #120 from jeremiahsb/main
feat: Supertonic TTS integration, Docker/GPU enhancements, PyQt support, and comprehensive test suite
2026-01-08 01:03:35 +03:00
Deniz Şafak 76cab1192c Merge pull request #119 from mohangk/main
Extracts book_parser.py from book_handler.py
2025-12-22 11:23:24 +03:00
Deniz Şafak 1c33a99554 Merge pull request #115 from cedarhillgoods/patch-1
Fixed typo (termminal > terminal)
2025-12-16 02:46:29 -08:00
Deniz Şafak 66a97835f0 Update README.md and pyproject.toml for improved installation instructions and development dependencies 2025-12-13 23:03:51 +03:00
Deniz Şafak 0d097f562a Update installation instructions for AMD GPUs and CUDA versions in README.md 2025-12-13 21:02:29 +03:00
Deniz Şafak a7ae13558c Add missing load_config import to subtitle_utils.py 2025-12-13 20:32:33 +03:00
Deniz Şafak 5735f05be0 Improve WINDOWS_INSTALL.bat to support version selection and install dependencies using uv 2025-12-13 20:27:48 +03:00
Deniz Şafak c3673b6dc7 Merge pull request #113 from mohangk/refactor
Extracts out subtitle_utils from conversion.py
2025-12-13 08:19:10 -08:00
Deniz Şafak 5010616e85 Add PyPI total downloads badge to README
Added a badge for total downloads from PyPI.
2025-12-12 04:33:39 +03:00
Deniz Şafak 65eecbcfee Update installation instructions in README for Silicon and Intel Mac support 2025-12-10 23:50:43 +03:00
Deniz Şafak c9b17b6f49 Update installation commands in README to include index strategy for CUDA and ROCm 2025-12-10 05:59:58 +03:00
Deniz Şafak 7722863435 Update installation commands in README to include extra index URLs for CUDA and ROCm 2025-12-10 05:40:16 +03:00
Deniz Şafak 6a1928483b Fix numpy error 2025-12-10 04:22:30 +03:00
Deniz Şafak 2a20dfab6f Update readme 2025-12-10 04:19:12 +03:00
Deniz Şafak a2f186e7a1 Update installation command in README to include Kokoro dependency 2025-12-10 04:17:18 +03:00
Deniz Şafak 56f81ef892 v1.2.5 2025-12-10 03:35:00 +03:00
Deniz Şafak 968c673e58 Fixed incorrect sentence segmentation when using spaCy 2025-12-10 03:20:59 +03:00
Deniz Şafak 174ff4232f Update installation instructions in README for uv 2025-12-10 03:03:49 +03:00
Deniz Şafak c43659005e Added new option: Override item settings with current selection 2025-12-10 01:27:00 +03:00
Deniz Şafak e3cdd1a9ca Fixed Error "Could not load the Qt platform plugin "xcb" mentioned in #101 2025-12-09 04:24:38 +03:00
Deniz Şafak ed31aaf632 Implement PyPI package builder script with version handling and build module installation 2025-12-09 01:00:35 +03:00
Deniz Şafak 0820c40b14 uv integration: add optional dependencies and index definitions for CUDA and ROCm configurations 2025-12-08 23:00:57 +03:00
Deniz Şafak 0ac2810515 update changelog 2025-12-03 21:36:47 +03:00
Deniz Şafak 1c3fd9e4cf Fix #109 2025-12-03 21:34:35 +03:00
Deniz Şafak e96c19ace6 Fixed the No module named pip error 2025-11-29 13:21:33 +03:00
Deniz Şafak 4e678c7e13 Fix defaults for replace_single_newlines variable 2025-11-28 23:25:02 +03:00
Deniz Şafak 7ee40d6aca Add web application version of Abogen
Added information about the web application version of Abogen, including repository access and future plans for merging.
2025-11-28 17:06:23 +03:00
Deniz Şafak 55a4f958ee Update changelog 2025-11-28 05:17:31 +03:00
Deniz Şafak 6c633e9167 v1.2.4 2025-11-28 05:16:39 +03:00
Deniz Şafak 566158c132 Reformat using black 2025-11-28 05:07:26 +03:00
Deniz Şafak bf43d1799d Update readme 2025-11-28 05:06:51 +03:00
Deniz Şafak 7293b4b826 New option: **Pre-download models and voices for offline use** 2025-11-28 04:58:13 +03:00
Deniz Şafak 34f2d712b3 Update readme 2025-11-28 00:56:44 +03:00
Deniz Şafak 5ef2612df6 Add spaCy support for improved sentence segmentation, possible fix for #91 2025-11-28 00:49:36 +03:00
Deniz Şafak 290c265d5e Improve cleanup_preview_threads function 2025-11-24 00:46:13 +03:00
Deniz Şafak ed418ac11d Added support for . separator in timestamps 2025-11-23 17:30:05 +03:00
Deniz Şafak e6abf2e541 Change audiobook to audio 2025-11-23 16:07:28 +03:00
Deniz Şafak f5d95547c5 Added subtitle generation support for non-English languages, improvements in code and documentation 2025-11-23 16:03:41 +03:00
Deniz Şafak 795bd8f1aa Fix WINDWOS_INSTALL.bat 2025-11-22 15:41:40 +03:00
Deniz Şafak c4e2a5ef0d Merge pull request #103 from denizsafak/copilot/improve-slow-code-efficiency
Optimize regex compilation and eliminate busy-wait loops
2025-11-22 15:22:15 +03:00
Deniz Şafak f57d1994cf Update CHANGELOG.md for pre-release 1.2.4: optimize regex compilation and eliminate busy-wait loops 2025-11-22 15:20:17 +03:00
Deniz Şafak 6482a56479 Remove unused import of QEventLoop 2025-11-22 15:14:41 +03:00
Deniz Şafak 8ddfd01dff Delete test_performance.py 2025-11-22 15:13:50 +03:00
Deniz Şafak ac551abd55 Delete PERFORMANCE_OPTIMIZATIONS.md 2025-11-22 15:13:36 +03:00
Deniz Şafak f477703b1a v1.2.3 2025-11-19 02:24:42 +03:00
Deniz Şafak 6b3125b624 v1.2.2 2025-11-19 02:06:33 +03:00
Deniz Şafak bb5c4204de Reformat using black 2025-11-19 01:54:11 +03:00
Deniz Şafak 43f5589a9d Update changelog and images 2025-11-19 01:39:50 +03:00
Deniz Şafak 10d3f470e7 Add support for embedding cover images in M4B files and update documentation 2025-11-19 01:03:10 +03:00
Deniz Şafak c72c8e777c Update CHANGELOG 2025-11-18 15:27:09 +03:00
Deniz Şafak b51e094af1 Update CHANGELOG with subtitle audio generation details
Added detailed instructions for generating audio from subtitle files.
2025-11-18 15:24:44 +03:00
Deniz Şafak 04844997d5 Update README.md 2025-11-18 15:13:42 +03:00