Add more supported file format type (#194)

This commit is contained in:
Chidi Williams 2022-11-29 01:19:24 +00:00 committed by GitHub
commit 2804159981
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -9,8 +9,8 @@ from typing import Any, Dict, List, Optional, Tuple
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 requests import get
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 @@ class AppIcon(QIcon):
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 @@ class MainWindow(QMainWindow):
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()))

View file

@ -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