diff --git a/buzz/gui.py b/buzz/gui.py index 8d3cc6d7b..8fcbc0602 100644 --- a/buzz/gui.py +++ b/buzz/gui.py @@ -9,8 +9,8 @@ import humanize import sounddevice from PyQt6 import QtGui -from PyQt6.QtCore import (QDateTime, QObject, QRect, QSettings, Qt, QTimer, - QUrl, pyqtSignal, QThreadPool) +from PyQt6.QtCore import (QDateTime, QObject, QRect, QSettings, Qt, + QThreadPool, QTimer, QUrl, pyqtSignal) from PyQt6.QtGui import (QAction, QCloseEvent, QDesktopServices, QIcon, QKeySequence, QPixmap, QTextCursor) from PyQt6.QtWidgets import (QApplication, QCheckBox, QComboBox, QDialog, @@ -21,9 +21,9 @@ from whisper import tokenizer from .__version__ import VERSION +from .model_loader import ModelLoader from .transcriber import FileTranscriber, OutputFormat, RecordingTranscriber from .whispr import LOADED_WHISPER_DLL, Task -from .model_loader import ModelLoader APP_NAME = 'Buzz' @@ -770,7 +770,7 @@ def __init__(self): class AboutDialog(QDialog): - def __init__(self, parent: Optional[QWidget]=None) -> None: + def __init__(self, parent: Optional[QWidget] = None) -> None: super().__init__(parent) self.setFixedSize(200, 200) @@ -866,7 +866,7 @@ def __init__(self, title: str, w: int, h: int, parent: Optional[QWidget], *args) def on_import_audio_file_action(self): (file_path, _) = QFileDialog.getOpenFileName( - self, 'Select audio file', '', 'Audio Files (*.mp3 *.wav *.m4a *.ogg);;Video Files (*.mp4 *.webm *.ogm)') + self, 'Select audio file', '', FileTranscriber.SUPPORTED_FILE_FORMATS) if file_path == '': return self.new_import_window_triggered.emit((file_path, self.geometry())) diff --git a/buzz/transcriber.py b/buzz/transcriber.py index 62827ad18..f922f41c6 100644 --- a/buzz/transcriber.py +++ b/buzz/transcriber.py @@ -207,6 +207,7 @@ class FileTranscriber: stopped = False current_thread: Optional[Thread] = None current_process: Optional[multiprocessing.Process] = None + SUPPORTED_FILE_FORMATS = 'Audio files (*.mp3 *.wav *.m4a *.ogg);;Video files (*.mp4 *.webm *.ogm *.mov);;All files (*.*)' class Event(): pass