Fix [Errno 32] in Linux

This commit is contained in:
Deniz Şafak
2025-05-10 00:44:26 +03:00
parent 85481ad119
commit 7fff2f154c
4 changed files with 5 additions and 4 deletions
-2
View File
@@ -603,7 +603,6 @@ class ConversionThread(QThread):
opus_out_path,
]
try:
print(f"Executing FFMPEG for Opus: {' '.join(ffmpeg_cmd_opus)}")
process = create_process(ffmpeg_cmd_opus, stdin=subprocess.PIPE, text=False) # Ensure binary stdin
process.stdin.write(audio_data_np.astype("float32").tobytes())
process.stdin.close()
@@ -713,7 +712,6 @@ class ConversionThread(QThread):
]
self.log_updated.emit(f"Generating audio with chapters...\n")
print(f"Executing FFMPEG for M4B: {' '.join(ffmpeg_cmd)}")
process = create_process(ffmpeg_cmd, stdin=subprocess.PIPE, text=False) # Ensure binary stdin
process.stdin.write(audio_data_np.astype("float32").tobytes())
+3 -1
View File
@@ -485,6 +485,7 @@ class TextboxDialog(QDialog):
cursor.insertText("<<CHAPTER_MARKER:Title>>")
self.text_edit.setTextCursor(cursor)
self.update_char_count()
self.text_edit.setFocus()
class abogen(QWidget):
@@ -1808,7 +1809,7 @@ class abogen(QWidget):
# Add shortcut to desktop (Windows or Linux)
if platform.system() == "Windows" or platform.system() == "Linux":
# Use extended label on Linux
label = "Create desktop shortcut & install" if platform.system() == "Linux" else "Create desktop shortcut"
label = "Create desktop shortcut and install" if platform.system() == "Linux" else "Create desktop shortcut"
add_shortcut_action = QAction(label, self)
add_shortcut_action.triggered.connect(self.add_shortcut_to_desktop)
menu.addAction(add_shortcut_action)
@@ -2291,3 +2292,4 @@ Categories=AudioVideo;Audio;Utility;
"Setting Saved",
f"Maximum words per subtitle set to {value}.",
)
+1
View File
@@ -134,6 +134,7 @@ def create_process(cmd, stdin=None, text=True):
# Configure for binary I/O
kwargs["text"] = False
# For binary mode, 'encoding' and 'errors' arguments must not be passed to Popen
kwargs["bufsize"] = 0 # Use unbuffered mode for binary data
if stdin is not None:
kwargs["stdin"] = stdin