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
+1 -1
View File
@@ -7,7 +7,7 @@
- Added `Save in a project folder with metadata` option in the book handler, allowing users to save the converted items in a project folder with available metadata files. Useful if you want to work with the converted files in the future, issue mentioned by @Darthagnon in #15 - Added `Save in a project folder with metadata` option in the book handler, allowing users to save the converted items in a project folder with available metadata files. Useful if you want to work with the converted files in the future, issue mentioned by @Darthagnon in #15
- Added `Go to folder` button in input box, allowing users to open the folder containing the converted file. - Added `Go to folder` button in input box, allowing users to open the folder containing the converted file.
- Added `.opus` as output format for generated audio files, which is a more efficient format for audio files. - Added `.opus` as output format for generated audio files, which is a more efficient format for audio files.
- Added `Create desktop shortcut & install` option to Linux version, allowing users to create a shortcut and install - Added `Create desktop shortcut and install` option to Linux version, allowing users to create a shortcut and install
- Added "Playing..." indicator for "Preview" button in the voice mixer. - Added "Playing..." indicator for "Preview" button in the voice mixer.
# v1.0.6 # v1.0.6
-2
View File
@@ -603,7 +603,6 @@ class ConversionThread(QThread):
opus_out_path, opus_out_path,
] ]
try: 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 = create_process(ffmpeg_cmd_opus, stdin=subprocess.PIPE, text=False) # Ensure binary stdin
process.stdin.write(audio_data_np.astype("float32").tobytes()) process.stdin.write(audio_data_np.astype("float32").tobytes())
process.stdin.close() process.stdin.close()
@@ -713,7 +712,6 @@ class ConversionThread(QThread):
] ]
self.log_updated.emit(f"Generating audio with chapters...\n") 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 = create_process(ffmpeg_cmd, stdin=subprocess.PIPE, text=False) # Ensure binary stdin
process.stdin.write(audio_data_np.astype("float32").tobytes()) 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>>") cursor.insertText("<<CHAPTER_MARKER:Title>>")
self.text_edit.setTextCursor(cursor) self.text_edit.setTextCursor(cursor)
self.update_char_count() self.update_char_count()
self.text_edit.setFocus()
class abogen(QWidget): class abogen(QWidget):
@@ -1808,7 +1809,7 @@ class abogen(QWidget):
# Add shortcut to desktop (Windows or Linux) # Add shortcut to desktop (Windows or Linux)
if platform.system() == "Windows" or platform.system() == "Linux": if platform.system() == "Windows" or platform.system() == "Linux":
# Use extended label on 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 = QAction(label, self)
add_shortcut_action.triggered.connect(self.add_shortcut_to_desktop) add_shortcut_action.triggered.connect(self.add_shortcut_to_desktop)
menu.addAction(add_shortcut_action) menu.addAction(add_shortcut_action)
@@ -2291,3 +2292,4 @@ Categories=AudioVideo;Audio;Utility;
"Setting Saved", "Setting Saved",
f"Maximum words per subtitle set to {value}.", 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 # Configure for binary I/O
kwargs["text"] = False kwargs["text"] = False
# For binary mode, 'encoding' and 'errors' arguments must not be passed to Popen # 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: if stdin is not None:
kwargs["stdin"] = stdin kwargs["stdin"] = stdin