Skip to content

Commit

Permalink
Add more supported file format type (chidiwilliams#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
chidiwilliams authored Nov 29, 2022
1 parent f358809 commit 2804159
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions buzz/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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'

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()))
Expand Down
1 change: 1 addition & 0 deletions buzz/transcriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2804159

Please sign in to comment.