mirror of
https://github.com/debpalash/VoiceStudio.git
synced 2026-12-04 01:18:16 +00:00
fix(batch): tell the user to pick a source language when ASR reports none
Batch dubbing stopped with a generic RuntimeError whose text was hidden behind More info. It now raises SourceLanguageRequiredError, a terminal SOURCE_LANGUAGE_REQUIRED failure class with a hint, and the batch card shows a localized message that says to choose the source language in Dubbing or use an ASR model that detects it.
This commit is contained in:
1 parent
ce2033a0fe
commit
561c62717b
26 files changed
+92
-6
No files matched your search
@@ -362,10 +362,9 @@ async def _run_batch_pipeline_leased(job_id: str, job: dict, lease: voice_leases
|
||||
return
|
||||
|
||||
if not source_lang:
|
||||
raise RuntimeError(
|
||||
"ASR did not return a detected source language. Use interactive dubbing "
|
||||
"and select the source language, or choose an ASR model that reports it."
|
||||
)
|
||||
# Never guess English: translating from the wrong language produces a
|
||||
# confident, wrong dub. Fail with a typed, actionable class instead.
|
||||
raise failure.SourceLanguageRequiredError()
|
||||
|
||||
# ── Engine resolution (issue #312 class) ────────────────────────────
|
||||
# Batch used to hardcode VoiceStudio regardless of the engine selected in
|
||||
|
||||
@@ -87,6 +87,24 @@ class InvalidMediaFileError(ValueError):
|
||||
super().__init__(message)
|
||||
|
||||
|
||||
SOURCE_LANGUAGE_REQUIRED_MESSAGE = (
|
||||
"Speech recognition did not report which language this video is spoken in, "
|
||||
"so batch dubbing cannot translate it. Open the video in Dubbing and choose "
|
||||
"its source language, or select a speech recognition model that detects the "
|
||||
"language, then try again."
|
||||
)
|
||||
|
||||
|
||||
class SourceLanguageRequiredError(ValueError):
|
||||
"""ASR reported no language and nobody chose one, so there is nothing to translate from."""
|
||||
|
||||
code = "source_language_required"
|
||||
docs_topic = "SOURCE_LANGUAGE_REQUIRED"
|
||||
|
||||
def __init__(self, message: str = SOURCE_LANGUAGE_REQUIRED_MESSAGE):
|
||||
super().__init__(message)
|
||||
|
||||
|
||||
def is_no_audio_stream_stderr(text: "str | bytes | None") -> bool:
|
||||
"""True when ffmpeg's stderr says the input had no audio stream to extract.
|
||||
|
||||
@@ -188,6 +206,10 @@ _HINTS: dict[str, str] = {
|
||||
# stream … Error opening output files: Invalid argument", which the dub
|
||||
# page showed verbatim and which read as a disk/permission problem.
|
||||
"NO_AUDIO_TRACK": "Check that the file plays with sound in a media player. If its audio is in a separate file, choose that file instead, or merge the audio into the video first.",
|
||||
# The ASR engine (e.g. a whisper.cpp build without language metadata)
|
||||
# reported no language. Batch has no source picker, so Dubbing is the place
|
||||
# to choose one; guessing English would translate the wrong language.
|
||||
"SOURCE_LANGUAGE_REQUIRED": "Open the video in Dubbing, choose its source language and translate there, or pick a speech recognition model in Model Catalogue that detects the spoken language.",
|
||||
"INVALID_MEDIA_FILE": "Check the source in a media player. If it cannot play, wait for the download or copy to finish, free disk space if needed, then download a fresh copy and upload it again.",
|
||||
# #2929/#2678: the voice has no transcript and no speech-to-text model is
|
||||
# installed to produce one, so the only advice that works is one of those two.
|
||||
@@ -486,6 +508,8 @@ _TERMINAL_FAILURE_CLASSES = frozenset({
|
||||
"WINDOWS_APP_CONTROL_BLOCKED",
|
||||
# The same file has no audio on every retry.
|
||||
"NO_AUDIO_TRACK",
|
||||
# The same transcript reports no language on every retry.
|
||||
"SOURCE_LANGUAGE_REQUIRED",
|
||||
# A missing package or a missing transcript model does not appear between
|
||||
# two renders of the same request.
|
||||
"ENGINE_DEPENDENCY_MISSING",
|
||||
@@ -662,6 +686,8 @@ def classify(reason: BaseException | str) -> str:
|
||||
return "NO_AUDIO_TRACK"
|
||||
if INVALID_MEDIA_FILE_MESSAGE.lower() in low:
|
||||
return "INVALID_MEDIA_FILE"
|
||||
if SOURCE_LANGUAGE_REQUIRED_MESSAGE.lower() in low:
|
||||
return "SOURCE_LANGUAGE_REQUIRED"
|
||||
if "pkg_resources" in low:
|
||||
return "PKG_RESOURCES_MISSING"
|
||||
if "quarantine" in low or "is damaged" in low or "gatekeeper" in low:
|
||||
|
||||
@@ -2970,6 +2970,7 @@
|
||||
"windows_app_control_blocked": "حظر التحكم في التطبيقات في Windows ملفًا مطلوبًا. اطلب من المسؤول السماح ببيئة تشغيل VoiceStudio الموثوقة، ثم أعد تشغيل التطبيق.",
|
||||
"audio_io_failed": "تعذرت قراءة الصوت أو حفظه. تحقق من تنسيق الملف ومساحة القرص المتاحة وأذونات الملفات. راجع المجلد في الإعدادات ← التخزين.",
|
||||
"no_audio_track": "لا يحتوي هذا الملف على مسار صوتي، لذا لا يوجد كلام لتفريغه أو دبلجته أو استنساخه. اختر ملف فيديو أو صوت يحتوي على صوت.",
|
||||
"source_language_required": "لم يحدد التعرف على الكلام لغة هذا الفيديو، لذا لا يمكن ترجمته هنا. افتح الفيديو في الدبلجة واختر لغته المصدر، أو اختر نموذج تعرّف على الكلام يكتشف اللغة.",
|
||||
"transcription_media_tool": "يحتاج التفريغ النصي إلى ffmpeg، ولم يتمكن VoiceStudio من العثور عليه أو تشغيله. افتح الإعدادات ← أدوات الصوت واستخدم تنزيل/إصلاح، أو ثبّت ffmpeg (macOS: brew install ffmpeg؛ Windows: winget install Gyan.FFmpeg؛ Linux: مدير الحزم لديك) ثم أعد تشغيل VoiceStudio. يمكنك أيضًا توجيه FFMPEG_PATH إلى ملف ffmpeg.",
|
||||
"transcription_pipe_lost": "فقد الخادم الخلفي قناة الإخراج إلى التطبيق أثناء التفريغ النصي (broken pipe). أعد تشغيل VoiceStudio وحاول مرة أخرى.",
|
||||
"gpu_oom": "نفدت ذاكرة وحدة معالجة الرسومات. أغلق التطبيقات الأخرى التي تستخدمها بكثافة أو أفرغ النماذج ثم أعد المحاولة. يمكنك أيضًا اختيار المعالج (CPU) في الإعدادات ← الأداء والجهاز أو اختيار محرك TTS أصغر.",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Die Windows-Anwendungssteuerung hat eine benötigte Datei blockiert. Bitte deinen Administrator, die vertrauenswürdige VoiceStudio-Laufzeit zuzulassen, und starte die App neu.",
|
||||
"audio_io_failed": "Die Audiodatei konnte nicht gelesen oder gespeichert werden. Prüfe Dateiformat, freien Speicherplatz und Dateiberechtigungen. Überprüfe den Ordner unter Einstellungen → Speicher.",
|
||||
"no_audio_track": "Diese Datei hat keine Tonspur, daher gibt es keine Sprache zum Transkribieren, Synchronisieren oder Klonen. Wähle eine Video- oder Audiodatei mit Ton.",
|
||||
"source_language_required": "Die Spracherkennung hat nicht gemeldet, in welcher Sprache dieses Video gesprochen ist, daher kann es hier nicht übersetzt werden. Öffne das Video in der Synchronisation und wähle die Ausgangssprache, oder wähle ein Spracherkennungsmodell, das die Sprache erkennt.",
|
||||
"transcription_media_tool": "Für die Transkription wird ffmpeg benötigt, das VoiceStudio nicht finden oder ausführen konnte. Öffne Einstellungen → Audiotools und nutze Herunterladen/Reparieren, oder installiere ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: dein Paketmanager) und starte VoiceStudio neu. Alternativ kannst du FFMPEG_PATH auf eine ffmpeg-Datei setzen.",
|
||||
"transcription_pipe_lost": "Das Backend hat während der Transkription seine Ausgabe-Pipe zur App verloren (Broken Pipe). Starte VoiceStudio neu und versuche es erneut.",
|
||||
"gpu_oom": "Der GPU ist der Speicher ausgegangen. Schließe andere GPU-intensive Apps oder entlade Modelle und versuche es erneut. Du kannst auch unter Einstellungen → Leistung & Gerät die CPU wählen oder eine kleinere TTS-Engine auswählen.",
|
||||
|
||||
@@ -583,6 +583,7 @@
|
||||
"windows_app_control_blocked": "Windows application control blocked a required file. Ask your administrator to allow the trusted VoiceStudio runtime, then restart the app.",
|
||||
"audio_io_failed": "Audio could not be read or saved. Check the file format, free disk space, and file permissions. Review the folder in Settings → Storage.",
|
||||
"no_audio_track": "This file has no audio track, so there is no speech to transcribe, dub or clone. Choose a video or audio file that contains sound.",
|
||||
"source_language_required": "Speech recognition did not report which language this video is spoken in, so it can't be translated here. Open the video in Dubbing and choose its source language, or pick a speech recognition model that detects the language.",
|
||||
"transcription_media_tool": "Transcription needs ffmpeg, which VoiceStudio could not find or run. Open Settings → Audio tools and use Download/Repair, or install ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: your package manager) and restart VoiceStudio. You can also point FFMPEG_PATH at an ffmpeg binary.",
|
||||
"transcription_pipe_lost": "The backend lost its output pipe to the app while transcribing (broken pipe). Restart VoiceStudio and try again.",
|
||||
"gpu_oom": "The GPU ran out of memory. Close other GPU-heavy apps or unload models, then retry. You can also choose CPU in Settings → Performance & Device or select a smaller TTS engine.",
|
||||
|
||||
@@ -2964,6 +2964,7 @@
|
||||
"windows_app_control_blocked": "El control de aplicaciones de Windows bloqueó un archivo necesario. Pide al administrador que permita el entorno de ejecución de confianza de VoiceStudio y reinicia la aplicación.",
|
||||
"audio_io_failed": "No se pudo leer o guardar el audio. Comprueba el formato, el espacio libre y los permisos del archivo. Revisa la carpeta en Ajustes → Almacenamiento.",
|
||||
"no_audio_track": "Este archivo no tiene pista de audio, así que no hay voz que transcribir, doblar o clonar. Elige un archivo de vídeo o audio que tenga sonido.",
|
||||
"source_language_required": "El reconocimiento de voz no indicó en qué idioma está este video, así que no se puede traducir aquí. Abre el video en Doblaje y elige su idioma de origen, o selecciona un modelo de reconocimiento de voz que detecte el idioma.",
|
||||
"transcription_media_tool": "La transcripción necesita ffmpeg, que VoiceStudio no pudo encontrar o ejecutar. Abre Ajustes → Herramientas de audio y usa Descargar/Reparar, o instala ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: tu gestor de paquetes) y reinicia VoiceStudio. También puedes apuntar FFMPEG_PATH a un binario de ffmpeg.",
|
||||
"transcription_pipe_lost": "El backend perdió su canal de salida con la aplicación durante la transcripción (broken pipe). Reinicia VoiceStudio e inténtalo de nuevo.",
|
||||
"gpu_oom": "La GPU se quedó sin memoria. Cierra otras apps que usen mucho la GPU o descarga modelos y vuelve a intentarlo. También puedes elegir CPU en Ajustes → Rendimiento y dispositivo o seleccionar un motor TTS más pequeño.",
|
||||
|
||||
@@ -2964,6 +2964,7 @@
|
||||
"windows_app_control_blocked": "Le contrôle des applications de Windows a bloqué un fichier nécessaire. Demandez à votre administrateur d’autoriser l’environnement d’exécution fiable de VoiceStudio, puis redémarrez l’application.",
|
||||
"audio_io_failed": "Impossible de lire ou d’enregistrer l’audio. Vérifiez le format du fichier, l’espace disque disponible et les autorisations. Vérifiez le dossier dans Paramètres → Stockage.",
|
||||
"no_audio_track": "Ce fichier n'a pas de piste audio : il n'y a donc aucune parole à transcrire, doubler ou cloner. Choisissez un fichier vidéo ou audio qui contient du son.",
|
||||
"source_language_required": "La reconnaissance vocale n'a pas indiqué la langue parlée dans cette vidéo, elle ne peut donc pas être traduite ici. Ouvrez la vidéo dans Doublage et choisissez sa langue source, ou sélectionnez un modèle de reconnaissance vocale qui détecte la langue.",
|
||||
"transcription_media_tool": "La transcription nécessite ffmpeg, que VoiceStudio n'a pas pu trouver ou exécuter. Ouvrez Paramètres → Outils audio et utilisez Télécharger/Réparer, ou installez ffmpeg (macOS : brew install ffmpeg ; Windows : winget install Gyan.FFmpeg ; Linux : votre gestionnaire de paquets), puis redémarrez VoiceStudio. Vous pouvez aussi faire pointer FFMPEG_PATH vers un binaire ffmpeg.",
|
||||
"transcription_pipe_lost": "Le backend a perdu son canal de sortie vers l'application pendant la transcription (broken pipe). Redémarrez VoiceStudio et réessayez.",
|
||||
"gpu_oom": "La mémoire du GPU est saturée. Fermez les autres applications gourmandes en GPU ou déchargez des modèles, puis réessayez. Vous pouvez aussi choisir le CPU dans Paramètres → Performances et appareil ou sélectionner un moteur TTS plus léger.",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Windows एप्लिकेशन नियंत्रण ने एक ज़रूरी फ़ाइल को रोक दिया। अपने व्यवस्थापक से विश्वसनीय VoiceStudio रनटाइम को अनुमति देने के लिए कहें, फिर ऐप दोबारा शुरू करें।",
|
||||
"audio_io_failed": "ऑडियो पढ़ा या सहेजा नहीं जा सका। फ़ाइल का प्रारूप, डिस्क में खाली जगह और फ़ाइल की अनुमतियाँ जाँचें। सेटिंग्स → स्टोरेज में फ़ोल्डर जाँचें।",
|
||||
"no_audio_track": "इस फ़ाइल में कोई ऑडियो ट्रैक नहीं है, इसलिए ट्रांसक्राइब, डब या क्लोन करने के लिए कोई आवाज़ नहीं है। ऐसी वीडियो या ऑडियो फ़ाइल चुनें जिसमें ध्वनि हो।",
|
||||
"source_language_required": "वाक् पहचान ने यह नहीं बताया कि इस वीडियो में कौन सी भाषा बोली गई है, इसलिए इसका यहाँ अनुवाद नहीं हो सकता। वीडियो को डबिंग में खोलें और उसकी स्रोत भाषा चुनें, या ऐसा वाक् पहचान मॉडल चुनें जो भाषा पहचानता हो।",
|
||||
"transcription_media_tool": "ट्रांसक्रिप्शन के लिए ffmpeg चाहिए, जिसे VoiceStudio ढूँढ या चला नहीं सका। सेटिंग्स → ऑडियो टूल खोलकर डाउनलोड/रिपेयर इस्तेमाल करें, या ffmpeg इंस्टॉल करें (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: आपका पैकेज मैनेजर) और VoiceStudio फिर से शुरू करें। आप FFMPEG_PATH को किसी ffmpeg फ़ाइल की ओर भी इंगित कर सकते हैं।",
|
||||
"transcription_pipe_lost": "ट्रांसक्रिप्शन के दौरान बैकएंड का ऐप से आउटपुट पाइप टूट गया (broken pipe)। VoiceStudio फिर से शुरू करें और दोबारा कोशिश करें।",
|
||||
"gpu_oom": "GPU की मेमोरी खत्म हो गई। GPU का भारी उपयोग करने वाले दूसरे ऐप बंद करें या मॉडल अनलोड करें, फिर दोबारा कोशिश करें। आप सेटिंग्स → प्रदर्शन और डिवाइस में CPU चुन सकते हैं या छोटा TTS इंजन चुन सकते हैं।",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Kontrol aplikasi Windows memblokir file yang diperlukan. Minta administrator mengizinkan runtime VoiceStudio yang tepercaya, lalu mulai ulang aplikasi.",
|
||||
"audio_io_failed": "Audio tidak dapat dibaca atau disimpan. Periksa format file, ruang disk yang tersedia, dan izin file. Periksa folder di Pengaturan → Penyimpanan.",
|
||||
"no_audio_track": "File ini tidak memiliki trek audio, jadi tidak ada ucapan untuk ditranskripsi, di-dubbing, atau dikloning. Pilih file video atau audio yang berisi suara.",
|
||||
"source_language_required": "Pengenalan suara tidak melaporkan bahasa yang diucapkan dalam video ini, jadi video tidak dapat diterjemahkan di sini. Buka video di Sulih Suara dan pilih bahasa sumbernya, atau pilih model pengenalan suara yang mendeteksi bahasa.",
|
||||
"transcription_media_tool": "Transkripsi membutuhkan ffmpeg, yang tidak dapat ditemukan atau dijalankan VoiceStudio. Buka Pengaturan → Alat audio lalu gunakan Unduh/Perbaiki, atau instal ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: pengelola paket Anda) dan mulai ulang VoiceStudio. Anda juga dapat mengarahkan FFMPEG_PATH ke berkas ffmpeg.",
|
||||
"transcription_pipe_lost": "Backend kehilangan saluran keluarannya ke aplikasi saat transkripsi (broken pipe). Mulai ulang VoiceStudio dan coba lagi.",
|
||||
"gpu_oom": "GPU kehabisan memori. Tutup aplikasi lain yang berat memakai GPU atau bongkar model, lalu coba lagi. Anda juga bisa memilih CPU di Pengaturan → Performa & Perangkat atau memilih mesin TTS yang lebih kecil.",
|
||||
|
||||
@@ -2964,6 +2964,7 @@
|
||||
"windows_app_control_blocked": "Il controllo delle applicazioni di Windows ha bloccato un file necessario. Chiedi all’amministratore di autorizzare il runtime attendibile di VoiceStudio, quindi riavvia l’app.",
|
||||
"audio_io_failed": "Impossibile leggere o salvare l’audio. Controlla il formato del file, lo spazio libero e le autorizzazioni. Verifica la cartella in Impostazioni → Archiviazione.",
|
||||
"no_audio_track": "Questo file non ha una traccia audio, quindi non c'è parlato da trascrivere, doppiare o clonare. Scegli un file video o audio che contenga suono.",
|
||||
"source_language_required": "Il riconoscimento vocale non ha indicato in quale lingua è parlato questo video, quindi non può essere tradotto qui. Apri il video in Doppiaggio e scegli la lingua di origine, oppure seleziona un modello di riconoscimento vocale che rileva la lingua.",
|
||||
"transcription_media_tool": "La trascrizione richiede ffmpeg, che VoiceStudio non ha trovato o non è riuscito a eseguire. Apri Impostazioni → Strumenti audio e usa Scarica/Ripara, oppure installa ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: il tuo gestore di pacchetti) e riavvia VoiceStudio. Puoi anche puntare FFMPEG_PATH a un binario ffmpeg.",
|
||||
"transcription_pipe_lost": "Il backend ha perso il canale di output verso l'app durante la trascrizione (broken pipe). Riavvia VoiceStudio e riprova.",
|
||||
"gpu_oom": "La GPU ha esaurito la memoria. Chiudi le altre app che usano molto la GPU o scarica i modelli, poi riprova. Puoi anche scegliere la CPU in Impostazioni → Prestazioni e dispositivo o selezionare un motore TTS più piccolo.",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Windowsのアプリケーション制御が必要なファイルをブロックしました。信頼できるVoiceStudioランタイムを許可するよう管理者に依頼し、アプリを再起動してください。",
|
||||
"audio_io_failed": "音声を読み込むか保存することができませんでした。ファイル形式、ディスクの空き容量、ファイルのアクセス権を確認してください。設定 → ストレージでフォルダーを確認してください。",
|
||||
"no_audio_track": "このファイルには音声トラックがないため、文字起こし・吹き替え・クローンする音声がありません。音声を含む動画または音声ファイルを選んでください。",
|
||||
"source_language_required": "音声認識がこの動画の話し言葉を報告しなかったため、ここでは翻訳できません。吹き替えで動画を開いて元の言語を選ぶか、言語を検出できる音声認識モデルを選んでください。",
|
||||
"transcription_media_tool": "文字起こしには ffmpeg が必要ですが、VoiceStudio は見つけられないか実行できませんでした。設定 → オーディオツールを開いてダウンロード/修復を使うか、ffmpeg をインストール(macOS: brew install ffmpeg、Windows: winget install Gyan.FFmpeg、Linux: お使いのパッケージマネージャー)して VoiceStudio を再起動してください。FFMPEG_PATH を ffmpeg のファイルに向けることもできます。",
|
||||
"transcription_pipe_lost": "文字起こし中にバックエンドがアプリへの出力パイプを失いました(broken pipe)。VoiceStudio を再起動してもう一度お試しください。",
|
||||
"gpu_oom": "GPU のメモリが不足しました。GPU を多く使う他のアプリを閉じるかモデルをアンロードしてから、もう一度お試しください。設定 → パフォーマンスとデバイスで CPU を選ぶか、より小さな TTS エンジンを選ぶこともできます。",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Windows 애플리케이션 제어가 필요한 파일을 차단했습니다. 관리자에게 신뢰할 수 있는 VoiceStudio 런타임을 허용하도록 요청한 뒤 앱을 다시 시작하세요.",
|
||||
"audio_io_failed": "오디오를 읽거나 저장할 수 없습니다. 파일 형식, 디스크 여유 공간 및 파일 권한을 확인하세요. 설정 → 저장소에서 폴더를 확인하세요.",
|
||||
"no_audio_track": "이 파일에는 오디오 트랙이 없어 전사, 더빙 또는 복제할 음성이 없습니다. 소리가 있는 동영상 또는 오디오 파일을 선택하세요.",
|
||||
"source_language_required": "음성 인식이 이 동영상의 언어를 알려 주지 않아 여기서 번역할 수 없습니다. 더빙에서 동영상을 열고 원본 언어를 선택하거나, 언어를 감지하는 음성 인식 모델을 선택하세요.",
|
||||
"transcription_media_tool": "전사에는 ffmpeg가 필요하지만 VoiceStudio가 찾거나 실행하지 못했습니다. 설정 → 오디오 도구에서 다운로드/복구를 사용하거나 ffmpeg를 설치(macOS: brew install ffmpeg, Windows: winget install Gyan.FFmpeg, Linux: 사용 중인 패키지 관리자)한 뒤 VoiceStudio를 다시 시작하세요. FFMPEG_PATH를 ffmpeg 파일로 지정할 수도 있습니다.",
|
||||
"transcription_pipe_lost": "전사 중 백엔드가 앱으로의 출력 파이프를 잃었습니다(broken pipe). VoiceStudio를 다시 시작한 뒤 다시 시도하세요.",
|
||||
"gpu_oom": "GPU 메모리가 부족합니다. GPU를 많이 쓰는 다른 앱을 닫거나 모델을 언로드한 뒤 다시 시도하세요. 설정 → 성능 및 장치에서 CPU를 선택하거나 더 작은 TTS 엔진을 선택할 수도 있습니다.",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Windows-toepassingsbeheer heeft een vereist bestand geblokkeerd. Vraag je beheerder de vertrouwde VoiceStudio-runtime toe te staan en start de app opnieuw.",
|
||||
"audio_io_failed": "De audio kon niet worden gelezen of opgeslagen. Controleer het bestandsformaat, de vrije schijfruimte en de bestandsrechten. Controleer de map bij Instellingen → Opslag.",
|
||||
"no_audio_track": "Dit bestand heeft geen audiotrack, dus er is geen spraak om te transcriberen, na te synchroniseren of te klonen. Kies een video- of audiobestand met geluid.",
|
||||
"source_language_required": "Spraakherkenning heeft niet gemeld in welke taal deze video gesproken is, dus hij kan hier niet worden vertaald. Open de video in Nasynchronisatie en kies de brontaal, of kies een spraakherkenningsmodel dat de taal detecteert.",
|
||||
"transcription_media_tool": "Voor transcriptie is ffmpeg nodig, dat VoiceStudio niet kon vinden of uitvoeren. Open Instellingen → Audiotools en gebruik Downloaden/Herstellen, of installeer ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: je pakketbeheerder) en herstart VoiceStudio. Je kunt ook FFMPEG_PATH naar een ffmpeg-bestand laten wijzen.",
|
||||
"transcription_pipe_lost": "De backend verloor tijdens de transcriptie zijn uitvoerkanaal naar de app (broken pipe). Herstart VoiceStudio en probeer het opnieuw.",
|
||||
"gpu_oom": "De GPU heeft geen geheugen meer. Sluit andere GPU-intensieve apps of ontlaad modellen en probeer het opnieuw. Je kunt ook CPU kiezen in Instellingen → Prestaties en apparaat of een kleinere TTS-engine selecteren.",
|
||||
|
||||
@@ -2966,6 +2966,7 @@
|
||||
"windows_app_control_blocked": "Kontrola aplikacji systemu Windows zablokowała wymagany plik. Poproś administratora o zezwolenie na uruchamianie zaufanego środowiska VoiceStudio, a następnie uruchom aplikację ponownie.",
|
||||
"audio_io_failed": "Nie można odczytać ani zapisać dźwięku. Sprawdź format pliku, wolne miejsce na dysku i uprawnienia do plików. Sprawdź folder w Ustawienia → Pamięć.",
|
||||
"no_audio_track": "Ten plik nie ma ścieżki dźwiękowej, więc nie ma mowy do transkrypcji, dubbingu ani klonowania. Wybierz plik wideo lub audio zawierający dźwięk.",
|
||||
"source_language_required": "Rozpoznawanie mowy nie podało, w jakim języku mówi się w tym filmie, więc nie można go tu przetłumaczyć. Otwórz film w Dubbingu i wybierz język źródłowy albo wybierz model rozpoznawania mowy, który wykrywa język.",
|
||||
"transcription_media_tool": "Transkrypcja wymaga ffmpeg, którego VoiceStudio nie mogło znaleźć lub uruchomić. Otwórz Ustawienia → Narzędzia audio i użyj Pobierz/Napraw albo zainstaluj ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: menedżer pakietów) i uruchom VoiceStudio ponownie. Możesz też wskazać plik ffmpeg w FFMPEG_PATH.",
|
||||
"transcription_pipe_lost": "Backend utracił kanał wyjściowy do aplikacji podczas transkrypcji (broken pipe). Uruchom VoiceStudio ponownie i spróbuj jeszcze raz.",
|
||||
"gpu_oom": "Procesorowi graficznemu zabrakło pamięci. Zamknij inne aplikacje mocno obciążające GPU lub wyładuj modele, a potem spróbuj ponownie. Możesz też wybrać CPU w Ustawienia → Wydajność i urządzenie albo mniejszy silnik TTS.",
|
||||
|
||||
@@ -2964,6 +2964,7 @@
|
||||
"windows_app_control_blocked": "O controle de aplicativos do Windows bloqueou um arquivo necessário. Peça ao administrador para permitir o ambiente de execução confiável do VoiceStudio e reinicie o aplicativo.",
|
||||
"audio_io_failed": "Não foi possível ler ou salvar o áudio. Verifique o formato do arquivo, o espaço livre e as permissões. Confira a pasta em Configurações → Armazenamento.",
|
||||
"no_audio_track": "Este arquivo não tem faixa de áudio, então não há fala para transcrever, dublar ou clonar. Escolha um arquivo de vídeo ou áudio que tenha som.",
|
||||
"source_language_required": "O reconhecimento de fala não informou em que idioma este vídeo é falado, então ele não pode ser traduzido aqui. Abra o vídeo em Dublagem e escolha o idioma de origem, ou selecione um modelo de reconhecimento de fala que detecte o idioma.",
|
||||
"transcription_media_tool": "A transcrição precisa do ffmpeg, que o VoiceStudio não conseguiu encontrar ou executar. Abra Configurações → Ferramentas de áudio e use Baixar/Reparar, ou instale o ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: seu gerenciador de pacotes) e reinicie o VoiceStudio. Você também pode apontar FFMPEG_PATH para um binário do ffmpeg.",
|
||||
"transcription_pipe_lost": "O backend perdeu o canal de saída para o aplicativo durante a transcrição (broken pipe). Reinicie o VoiceStudio e tente novamente.",
|
||||
"gpu_oom": "A GPU ficou sem memória. Feche outros apps que usam muito a GPU ou descarregue modelos e tente novamente. Você também pode escolher CPU em Configurações → Desempenho e dispositivo ou selecionar um mecanismo TTS menor.",
|
||||
|
||||
@@ -2966,6 +2966,7 @@
|
||||
"windows_app_control_blocked": "Контроль приложений Windows заблокировал нужный файл. Попросите администратора разрешить доверенную среду выполнения VoiceStudio, затем перезапустите приложение.",
|
||||
"audio_io_failed": "Не удалось прочитать или сохранить аудио. Проверьте формат файла, свободное место на диске и права доступа. Проверьте папку в Настройки → Хранилище.",
|
||||
"no_audio_track": "В этом файле нет звуковой дорожки, поэтому нечего расшифровывать, дублировать или клонировать. Выберите видео- или аудиофайл со звуком.",
|
||||
"source_language_required": "Распознавание речи не сообщило, на каком языке говорят в этом видео, поэтому здесь его нельзя перевести. Откройте видео в разделе «Дубляж» и выберите исходный язык или выберите модель распознавания речи, которая определяет язык.",
|
||||
"transcription_media_tool": "Для расшифровки нужен ffmpeg, который VoiceStudio не удалось найти или запустить. Откройте Настройки → Аудиоинструменты и нажмите Загрузить/Восстановить либо установите ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: ваш пакетный менеджер) и перезапустите VoiceStudio. Также можно указать в FFMPEG_PATH путь к ffmpeg.",
|
||||
"transcription_pipe_lost": "Во время расшифровки бэкенд потерял канал вывода к приложению (broken pipe). Перезапустите VoiceStudio и повторите попытку.",
|
||||
"gpu_oom": "У GPU закончилась память. Закройте другие приложения, активно использующие GPU, или выгрузите модели и повторите попытку. Также можно выбрать CPU в Настройки → Производительность и устройство или выбрать движок TTS поменьше.",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Windows programkontroll blockerade en nödvändig fil. Be administratören tillåta den betrodda VoiceStudio-körmiljön och starta sedan om appen.",
|
||||
"audio_io_failed": "Ljudet kunde inte läsas eller sparas. Kontrollera filformat, ledigt diskutrymme och filbehörigheter. Kontrollera mappen under Inställningar → Lagring.",
|
||||
"no_audio_track": "Filen saknar ljudspår, så det finns inget tal att transkribera, dubba eller klona. Välj en video- eller ljudfil som innehåller ljud.",
|
||||
"source_language_required": "Taligenkänningen rapporterade inte vilket språk som talas i videon, så den kan inte översättas här. Öppna videon i Dubbning och välj källspråket, eller välj en taligenkänningsmodell som identifierar språket.",
|
||||
"transcription_media_tool": "Transkribering kräver ffmpeg, som VoiceStudio inte kunde hitta eller köra. Öppna Inställningar → Ljudverktyg och använd Ladda ned/Reparera, eller installera ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: din pakethanterare) och starta om VoiceStudio. Du kan också peka FFMPEG_PATH mot en ffmpeg-fil.",
|
||||
"transcription_pipe_lost": "Backend förlorade sin utdatakanal till appen under transkriberingen (broken pipe). Starta om VoiceStudio och försök igen.",
|
||||
"gpu_oom": "GPU:n fick slut på minne. Stäng andra GPU-tunga appar eller avlasta modeller och försök igen. Du kan också välja CPU under Inställningar → Prestanda och enhet eller välja en mindre TTS-motor.",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "การควบคุมแอปพลิเคชันของ Windows บล็อกไฟล์ที่จำเป็น โปรดให้ผู้ดูแลระบบอนุญาตสภาพแวดล้อมการทำงานของ VoiceStudio ที่เชื่อถือได้ แล้วเริ่มแอปใหม่",
|
||||
"audio_io_failed": "ไม่สามารถอ่านหรือบันทึกเสียงได้ ตรวจสอบรูปแบบไฟล์ พื้นที่ดิสก์ว่าง และสิทธิ์เข้าถึงไฟล์ ตรวจสอบโฟลเดอร์ในการตั้งค่า → ที่เก็บข้อมูล",
|
||||
"no_audio_track": "ไฟล์นี้ไม่มีแทร็กเสียง จึงไม่มีเสียงพูดให้ถอดความ พากย์ หรือโคลน เลือกไฟล์วิดีโอหรือไฟล์เสียงที่มีเสียง",
|
||||
"source_language_required": "การรู้จำเสียงพูดไม่ได้ระบุว่าวิดีโอนี้พูดภาษาอะไร จึงแปลที่นี่ไม่ได้ เปิดวิดีโอในการพากย์เสียงแล้วเลือกภาษาต้นทาง หรือเลือกโมเดลรู้จำเสียงพูดที่ตรวจจับภาษาได้",
|
||||
"transcription_media_tool": "การถอดความต้องใช้ ffmpeg แต่ VoiceStudio หาหรือเรียกใช้ไม่ได้ เปิดการตั้งค่า → เครื่องมือเสียง แล้วใช้ดาวน์โหลด/ซ่อมแซม หรือติดตั้ง ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: ตัวจัดการแพ็กเกจของคุณ) แล้วรีสตาร์ท VoiceStudio หรือจะชี้ FFMPEG_PATH ไปยังไฟล์ ffmpeg ก็ได้",
|
||||
"transcription_pipe_lost": "แบ็กเอนด์สูญเสียช่องทางส่งออกไปยังแอประหว่างการถอดความ (broken pipe) โปรดรีสตาร์ท VoiceStudio แล้วลองอีกครั้ง",
|
||||
"gpu_oom": "หน่วยความจำ GPU หมด ปิดแอปอื่นที่ใช้ GPU หนักหรือยกเลิกการโหลดโมเดล แล้วลองอีกครั้ง คุณยังเลือก CPU ได้ที่ การตั้งค่า → ประสิทธิภาพและอุปกรณ์ หรือเลือกเอนจิน TTS ที่เล็กลง",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Windows uygulama denetimi gerekli bir dosyayı engelledi. Yöneticinizden güvenilir VoiceStudio çalışma ortamına izin vermesini isteyin, ardından uygulamayı yeniden başlatın.",
|
||||
"audio_io_failed": "Ses okunamadı veya kaydedilemedi. Dosya biçimini, boş disk alanını ve dosya izinlerini kontrol edin. Ayarlar → Depolama bölümündeki klasörü inceleyin.",
|
||||
"no_audio_track": "Bu dosyada ses parçası yok, bu yüzden yazıya dökülecek, dublajlanacak veya klonlanacak konuşma yok. Ses içeren bir video veya ses dosyası seçin.",
|
||||
"source_language_required": "Konuşma tanıma bu videoda hangi dilin konuşulduğunu bildirmedi, bu yüzden burada çevrilemiyor. Videoyu Seslendirme'de açıp kaynak dilini seçin veya dili algılayan bir konuşma tanıma modeli seçin.",
|
||||
"transcription_media_tool": "Yazıya dökme için ffmpeg gerekir, ancak VoiceStudio onu bulamadı veya çalıştıramadı. Ayarlar → Ses araçları bölümünü açıp İndir/Onar'ı kullanın ya da ffmpeg'i kurun (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: paket yöneticiniz) ve VoiceStudio'yu yeniden başlatın. FFMPEG_PATH değişkenini bir ffmpeg dosyasına da yönlendirebilirsiniz.",
|
||||
"transcription_pipe_lost": "Arka uç, yazıya dökme sırasında uygulamaya giden çıkış kanalını kaybetti (broken pipe). VoiceStudio'yu yeniden başlatıp tekrar deneyin.",
|
||||
"gpu_oom": "GPU belleği tükendi. GPU'yu çok kullanan diğer uygulamaları kapatın veya modelleri boşaltın, sonra tekrar deneyin. Ayarlar → Performans ve Aygıt bölümünden CPU'yu seçebilir veya daha küçük bir TTS motoru seçebilirsiniz.",
|
||||
|
||||
@@ -2966,6 +2966,7 @@
|
||||
"windows_app_control_blocked": "Контроль програм Windows заблокував потрібний файл. Попросіть адміністратора дозволити довірене середовище виконання VoiceStudio, а потім перезапустіть програму.",
|
||||
"audio_io_failed": "Не вдалося прочитати або зберегти аудіо. Перевірте формат файлу, вільне місце на диску та права доступу. Перевірте папку в Налаштування → Сховище.",
|
||||
"no_audio_track": "У цьому файлі немає звукової доріжки, тож нічого розшифровувати, дублювати чи клонувати. Виберіть відео- або аудіофайл зі звуком.",
|
||||
"source_language_required": "Розпізнавання мовлення не повідомило, якою мовою говорять у цьому відео, тому тут його не можна перекласти. Відкрийте відео в розділі «Дубляж» і виберіть мову оригіналу або виберіть модель розпізнавання мовлення, яка визначає мову.",
|
||||
"transcription_media_tool": "Для розшифрування потрібен ffmpeg, який VoiceStudio не вдалося знайти або запустити. Відкрийте Налаштування → Аудіоінструменти й натисніть Завантажити/Відновити або встановіть ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: ваш менеджер пакетів) і перезапустіть VoiceStudio. Також можна вказати в FFMPEG_PATH шлях до ffmpeg.",
|
||||
"transcription_pipe_lost": "Під час розшифрування бекенд втратив канал виводу до застосунку (broken pipe). Перезапустіть VoiceStudio і спробуйте ще раз.",
|
||||
"gpu_oom": "У GPU закінчилася пам'ять. Закрийте інші програми, що активно використовують GPU, або вивантажте моделі й повторіть спробу. Також можна вибрати CPU в Налаштування → Продуктивність і пристрій або менший рушій TTS.",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Tính năng kiểm soát ứng dụng của Windows đã chặn một tệp cần thiết. Nhờ quản trị viên cho phép môi trường chạy VoiceStudio đáng tin cậy, rồi khởi động lại ứng dụng.",
|
||||
"audio_io_failed": "Không thể đọc hoặc lưu âm thanh. Kiểm tra định dạng tệp, dung lượng đĩa trống và quyền truy cập tệp. Kiểm tra thư mục trong Cài đặt → Lưu trữ.",
|
||||
"no_audio_track": "Tệp này không có rãnh âm thanh nên không có lời nói để chép lời, lồng tiếng hoặc nhân bản. Hãy chọn tệp video hoặc âm thanh có tiếng.",
|
||||
"source_language_required": "Nhận dạng giọng nói không cho biết video này dùng ngôn ngữ nào, nên không thể dịch tại đây. Mở video trong Lồng tiếng và chọn ngôn ngữ nguồn, hoặc chọn mô hình nhận dạng giọng nói có thể phát hiện ngôn ngữ.",
|
||||
"transcription_media_tool": "Chép lời cần ffmpeg, nhưng VoiceStudio không thể tìm thấy hoặc chạy nó. Mở Cài đặt → Công cụ âm thanh và dùng Tải xuống/Sửa chữa, hoặc cài ffmpeg (macOS: brew install ffmpeg; Windows: winget install Gyan.FFmpeg; Linux: trình quản lý gói của bạn) rồi khởi động lại VoiceStudio. Bạn cũng có thể trỏ FFMPEG_PATH tới tệp ffmpeg.",
|
||||
"transcription_pipe_lost": "Backend đã mất kênh đầu ra tới ứng dụng khi đang chép lời (broken pipe). Hãy khởi động lại VoiceStudio và thử lại.",
|
||||
"gpu_oom": "GPU đã hết bộ nhớ. Hãy đóng các ứng dụng khác dùng nhiều GPU hoặc gỡ mô hình khỏi bộ nhớ rồi thử lại. Bạn cũng có thể chọn CPU trong Cài đặt → Hiệu năng & Thiết bị hoặc chọn công cụ TTS nhỏ hơn.",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Windows 应用程序控制阻止了所需文件。请联系管理员允许受信任的 VoiceStudio 运行环境,然后重启应用。",
|
||||
"audio_io_failed": "无法读取或保存音频。请检查文件格式、磁盘剩余空间和文件访问权限,并在设置 → 存储中检查文件夹。",
|
||||
"no_audio_track": "此文件没有音轨,因此没有可转录、配音或克隆的语音。请选择包含声音的视频或音频文件。",
|
||||
"source_language_required": "语音识别未报告此视频所用的语言,因此无法在此翻译。请在配音中打开该视频并选择其源语言,或选择能检测语言的语音识别模型。",
|
||||
"transcription_media_tool": "转录需要 ffmpeg,但 VoiceStudio 无法找到或运行它。请打开设置 → 音频工具并使用下载/修复,或安装 ffmpeg(macOS:brew install ffmpeg;Windows:winget install Gyan.FFmpeg;Linux:你的包管理器),然后重启 VoiceStudio。你也可以将 FFMPEG_PATH 指向 ffmpeg 可执行文件。",
|
||||
"transcription_pipe_lost": "转录期间后端丢失了通往应用的输出管道(broken pipe)。请重启 VoiceStudio 后重试。",
|
||||
"gpu_oom": "GPU 显存不足。请关闭其他占用 GPU 的应用或卸载模型后重试。你也可以在 设置 → 性能与设备 中选择 CPU,或选择更小的 TTS 引擎。",
|
||||
|
||||
@@ -2962,6 +2962,7 @@
|
||||
"windows_app_control_blocked": "Windows 應用程式控制封鎖了必要檔案。請聯絡管理員允許受信任的 VoiceStudio 執行環境,然後重新啟動應用程式。",
|
||||
"audio_io_failed": "無法讀取或儲存音訊。請檢查檔案格式、磁碟可用空間和檔案存取權限,並在設定 → 儲存空間中檢查資料夾。",
|
||||
"no_audio_track": "此檔案沒有音軌,因此沒有可轉錄、配音或複製的語音。請選擇包含聲音的影片或音訊檔案。",
|
||||
"source_language_required": "語音辨識未回報此影片使用的語言,因此無法在此翻譯。請在配音中開啟該影片並選擇其來源語言,或選擇能偵測語言的語音辨識模型。",
|
||||
"transcription_media_tool": "轉錄需要 ffmpeg,但 VoiceStudio 找不到或無法執行它。請開啟設定 → 音訊工具並使用下載/修復,或安裝 ffmpeg(macOS:brew install ffmpeg;Windows:winget install Gyan.FFmpeg;Linux:你的套件管理員),然後重新啟動 VoiceStudio。你也可以將 FFMPEG_PATH 指向 ffmpeg 執行檔。",
|
||||
"transcription_pipe_lost": "轉錄期間後端失去了通往應用程式的輸出管道(broken pipe)。請重新啟動 VoiceStudio 後再試一次。",
|
||||
"gpu_oom": "GPU 記憶體不足。請關閉其他佔用 GPU 的應用程式或卸載模型後重試。你也可以在 設定 → 效能與裝置 中選擇 CPU,或選擇較小的 TTS 引擎。",
|
||||
|
||||
@@ -28,6 +28,7 @@ describe('generationFailureMessage', () => {
|
||||
['HOST_MEMORY_EXHAUSTED', 'tts_errors.host_memory_exhausted'],
|
||||
['ENGINE_DEPENDENCY_MISSING', 'tts_errors.engine_dependency_missing'],
|
||||
['REFERENCE_STT_MISSING', 'tts_errors.reference_stt_missing'],
|
||||
['SOURCE_LANGUAGE_REQUIRED', 'tts_errors.source_language_required'],
|
||||
])('localizes the %s diagnostic topic instead of the generic floor message', (topic, key) => {
|
||||
const translate = vi.fn((k: string) => `t:${k}`);
|
||||
expect(generationFailureMessage({ docs_topic: topic }, translate)).toBe(`t:${key}`);
|
||||
@@ -35,7 +36,9 @@ describe('generationFailureMessage', () => {
|
||||
|
||||
it('never turns a server-supplied code into a translation key', () => {
|
||||
const translate = vi.fn();
|
||||
expect(generationFailureMessage({ code: 'tts_errors.no_audio_track' }, translate)).toBeUndefined();
|
||||
expect(
|
||||
generationFailureMessage({ code: 'tts_errors.no_audio_track' }, translate),
|
||||
).toBeUndefined();
|
||||
expect(translate).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -21,6 +21,8 @@ export function generationFailureMessage(
|
||||
return translate('tts_errors.audio_io_failed');
|
||||
case 'NO_AUDIO_TRACK':
|
||||
return translate('tts_errors.no_audio_track');
|
||||
case 'SOURCE_LANGUAGE_REQUIRED':
|
||||
return translate('tts_errors.source_language_required');
|
||||
case 'GPU_OOM':
|
||||
return translate('tts_errors.gpu_oom');
|
||||
case 'HOST_MEMORY_EXHAUSTED':
|
||||
|
||||
@@ -73,10 +73,45 @@ def test_batch_stops_before_translation_when_language_unknown(tmp_path, monkeypa
|
||||
raise AssertionError('Unknown source reached TTS resolution')
|
||||
monkeypatch.setattr(batch, '_batch_voice', no_tts)
|
||||
job = {'video_path': str(tmp_path / 'input.mp4'), 'langs': ['en'], 'status': 'running'}
|
||||
with pytest.raises(RuntimeError, match='detected source language'):
|
||||
from core.failure import SourceLanguageRequiredError, build_failure, is_terminal_failure_topic
|
||||
with pytest.raises(SourceLanguageRequiredError) as raised:
|
||||
asyncio.run(batch._run_batch_pipeline('unknown-language', job))
|
||||
assert job['source_lang'] is None
|
||||
assert job['segments'][0]['text'] == 'Goedemorgen'
|
||||
# The batch card shows a localized, actionable class, not a hidden raw error.
|
||||
failed = build_failure(raised.value, stage='batch', include_diagnostic=False)
|
||||
assert failed['docs_topic'] == 'SOURCE_LANGUAGE_REQUIRED'
|
||||
assert 'choose its source language' in failed['reason']
|
||||
assert 'source language' in failed['hint']
|
||||
assert is_terminal_failure_topic(failed['docs_topic'])
|
||||
|
||||
|
||||
def test_batch_worker_records_actionable_source_language_failure(monkeypatch):
|
||||
from api.routers import batch
|
||||
from core.failure import SourceLanguageRequiredError
|
||||
|
||||
async def pipeline(_job_id, _job):
|
||||
raise SourceLanguageRequiredError()
|
||||
|
||||
monkeypatch.setattr(batch, '_run_batch_pipeline', pipeline)
|
||||
job = {'id': 'no-lang', 'status': 'queued', 'filename': 'a.mp4'}
|
||||
|
||||
async def run():
|
||||
batch._queue = asyncio.Queue()
|
||||
batch._jobs['no-lang'] = job
|
||||
await batch._queue.put('no-lang')
|
||||
worker = asyncio.create_task(batch._worker())
|
||||
await batch._queue.join()
|
||||
worker.cancel()
|
||||
|
||||
try:
|
||||
asyncio.run(run())
|
||||
finally:
|
||||
batch._jobs.pop('no-lang', None)
|
||||
batch._queue = None
|
||||
assert job['status'] == 'failed'
|
||||
assert job['docs_topic'] == 'SOURCE_LANGUAGE_REQUIRED'
|
||||
assert 'Dubbing' in job['error']
|
||||
|
||||
@pytest.mark.parametrize('override', [None, 'fr'])
|
||||
def test_whole_file_dub_preserves_unknown_or_explicit_source(tmp_path, monkeypatch, m, override):
|
||||
|
||||
Reference in new issue
Block a user