mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f5dc85ae0 |
+5
-1
@@ -1,5 +1,9 @@
|
||||
# 1.1.4
|
||||
- Fixed extra metadata information not being saved to M4B files, ensuring that all metadata is correctly written to the output file.
|
||||
- Reformatted the code using Black for better readability and consistency.
|
||||
|
||||
# 1.1.3
|
||||
- `M4B (with chapters)` generation is faster now, as it directly generates `m4b` files instead of converting from `wav`, which significantly reduces processing time.
|
||||
- `M4B (with chapters)` generation is faster now, as it directly generates `m4b` files instead of converting from `wav`, which significantly reduces processing time, fixes the issue mentioned by @Milor123 in #39
|
||||
- Better sleep state handling for Linux.
|
||||
- The app window now tries to fit the screen if its height would exceed the available display area.
|
||||
- Fixed issue where the app would not restart properly on Windows.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.1.3
|
||||
1.1.4
|
||||
+40
-19
@@ -493,20 +493,26 @@ class ConversionThread(QThread):
|
||||
merged_out_file = None
|
||||
ffmpeg_proc = None
|
||||
# Prepare ffmpeg command for m4b output
|
||||
metadata_options = self._extract_and_add_metadata_tags_to_ffmpeg_cmd()
|
||||
cmd = [
|
||||
"ffmpeg",
|
||||
"-y",
|
||||
"-thread_queue_size", "32768",
|
||||
"-f", "f32le",
|
||||
"-ar", "24000",
|
||||
"-ac", "1",
|
||||
"-i", "pipe:0",
|
||||
"-c:a", "aac",
|
||||
"-q:a", "2",
|
||||
"-movflags", "+faststart+use_metadata_tags",
|
||||
"-thread_queue_size",
|
||||
"32768",
|
||||
"-f",
|
||||
"f32le",
|
||||
"-ar",
|
||||
"24000",
|
||||
"-ac",
|
||||
"1",
|
||||
"-i",
|
||||
"pipe:0",
|
||||
"-c:a",
|
||||
"aac",
|
||||
"-q:a",
|
||||
"2",
|
||||
"-movflags",
|
||||
"+faststart+use_metadata_tags",
|
||||
]
|
||||
cmd += metadata_options
|
||||
cmd.append(merged_out_path)
|
||||
ffmpeg_proc = create_process(cmd, stdin=subprocess.PIPE, text=False)
|
||||
elif self.output_format == "opus":
|
||||
@@ -807,7 +813,7 @@ class ConversionThread(QThread):
|
||||
tokens_with_timestamps,
|
||||
new_entries,
|
||||
self.max_subtitle_words,
|
||||
fallback_end_time=chunk_start + chunk_dur
|
||||
fallback_end_time=chunk_start + chunk_dur,
|
||||
)
|
||||
if merged_subtitle_file:
|
||||
subtitle_format = getattr(
|
||||
@@ -945,17 +951,27 @@ class ConversionThread(QThread):
|
||||
orig_path = merged_out_path
|
||||
root, ext = os.path.splitext(orig_path)
|
||||
tmp_path = root + ".tmp" + ext
|
||||
metadata_options = (
|
||||
self._extract_and_add_metadata_tags_to_ffmpeg_cmd()
|
||||
)
|
||||
cmd = [
|
||||
"ffmpeg",
|
||||
"-y",
|
||||
"-i", orig_path,
|
||||
"-i", chapters_info_path,
|
||||
"-map", "0:a",
|
||||
"-map_metadata", "1",
|
||||
"-map_chapters", "1",
|
||||
"-c:a", "copy",
|
||||
tmp_path
|
||||
"-i",
|
||||
orig_path,
|
||||
"-i",
|
||||
chapters_info_path,
|
||||
"-map",
|
||||
"0:a",
|
||||
"-map_metadata",
|
||||
"1",
|
||||
"-map_chapters",
|
||||
"1",
|
||||
"-c:a",
|
||||
"copy",
|
||||
]
|
||||
cmd += metadata_options
|
||||
cmd.append(tmp_path)
|
||||
proc = create_process(cmd)
|
||||
proc.wait()
|
||||
os.replace(tmp_path, orig_path)
|
||||
@@ -1126,7 +1142,11 @@ class ConversionThread(QThread):
|
||||
return f"{h}:{m:02}:{s:02}.{cs:02}"
|
||||
|
||||
def _process_subtitle_tokens(
|
||||
self, tokens_with_timestamps, subtitle_entries, max_subtitle_words, fallback_end_time=None
|
||||
self,
|
||||
tokens_with_timestamps,
|
||||
subtitle_entries,
|
||||
max_subtitle_words,
|
||||
fallback_end_time=None,
|
||||
):
|
||||
"""Helper function to process subtitle tokens according to the subtitle mode"""
|
||||
if not tokens_with_timestamps:
|
||||
@@ -1222,6 +1242,7 @@ class ConversionThread(QThread):
|
||||
start, end, text = last_entry
|
||||
if end is None or end <= start or end <= 0:
|
||||
subtitle_entries[-1] = (start, fallback_end_time, text)
|
||||
|
||||
def cancel(self):
|
||||
self.cancel_requested = True
|
||||
self.should_cancel = True
|
||||
|
||||
+3
-2
@@ -2822,14 +2822,15 @@ class abogen(QWidget):
|
||||
def restart_app(self):
|
||||
from PyQt5.QtCore import QProcess
|
||||
import sys
|
||||
|
||||
exe = sys.executable
|
||||
args = sys.argv
|
||||
|
||||
# On Windows, use .exe if available
|
||||
if platform.system() == "Windows":
|
||||
script_path = args[0]
|
||||
if not script_path.lower().endswith('.exe'):
|
||||
exe_path = os.path.splitext(script_path)[0] + '.exe'
|
||||
if not script_path.lower().endswith(".exe"):
|
||||
exe_path = os.path.splitext(script_path)[0] + ".exe"
|
||||
if os.path.exists(exe_path):
|
||||
args[0] = exe_path
|
||||
|
||||
|
||||
@@ -245,6 +245,7 @@ def get_gpu_acceleration(enabled):
|
||||
|
||||
def prevent_sleep_start():
|
||||
from abogen.constants import PROGRAM_NAME
|
||||
|
||||
system = platform.system()
|
||||
if system == "Windows":
|
||||
import ctypes
|
||||
|
||||
Reference in New Issue
Block a user