mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 22:55:46 +01:00
Fix for subtitle resize crash on macOS (#1176)
This commit is contained in:
parent
039ab908f9
commit
778121e7ba
2 changed files with 15 additions and 8 deletions
|
|
@ -28,6 +28,7 @@ datas += copy_metadata("pyyaml")
|
|||
datas += collect_data_files("transformers", include_py_files=True)
|
||||
|
||||
datas += collect_data_files("faster_whisper", include_py_files=True)
|
||||
datas += collect_data_files("stable_whisper", include_py_files=True)
|
||||
datas += collect_data_files("whisper")
|
||||
datas += [("demucs", "demucs")]
|
||||
datas += [("buzz/assets/*", "assets")]
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ from PyQt6.QtWidgets import (
|
|||
QSizePolicy,
|
||||
)
|
||||
from buzz.locale import _, languages
|
||||
from buzz import whisper_audio
|
||||
from buzz.db.entity.transcription import Transcription
|
||||
from buzz.db.service.transcription_service import TranscriptionService
|
||||
from buzz.paths import file_path_as_title
|
||||
|
|
@ -85,14 +86,19 @@ class TranscriptionWorker(QObject):
|
|||
transcription_file = str(speech_path)
|
||||
transcription_file_exists = True
|
||||
|
||||
result = stable_whisper.transcribe_any(
|
||||
self.get_transcript,
|
||||
transcription_file,
|
||||
vad=transcription_file_exists,
|
||||
suppress_silence=transcription_file_exists,
|
||||
regroup=self.regroup_string,
|
||||
check_sorted=False,
|
||||
)
|
||||
try:
|
||||
result = stable_whisper.transcribe_any(
|
||||
self.get_transcript,
|
||||
audio = whisper_audio.load_audio(transcription_file),
|
||||
input_sr=whisper_audio.SAMPLE_RATE,
|
||||
vad=transcription_file_exists,
|
||||
suppress_silence=transcription_file_exists,
|
||||
regroup=self.regroup_string,
|
||||
check_sorted=False,
|
||||
)
|
||||
except Exception as e:
|
||||
logging.error(f"Error in TranscriptionWorker: {e}")
|
||||
return
|
||||
|
||||
segments = []
|
||||
for segment in result.segments:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue