Skip to content

Commit 3b52f7e

Browse files
committed
Remove experimental whisper feature
1 parent 14cf9e5 commit 3b52f7e

3 files changed

Lines changed: 3 additions & 25 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Let's go over it line by line:
6565
**OPTIONAL** | This is a convenience feature. If specified, this will get inserted at the start of the subtitle, in bold text. In this example you can imagine the line as: "**Elie Simons**: Hey there my name is elie!". If not specified there will be no actor at the start of the line: "Hey there my name is elie!".
6666

6767
#### "cc" "..."
68-
**OPTIONAL** | The actual subtitle that will be shown when this scene plays. Experimentally, if this is not specified CCAutoVCD will try to recognize what is said in the specified sound file, and transcribe the message. It does so using `OpenAI whisper's "small" model`. It is not recommended though, as often the processing done on the line or other things can confuse the transcriber. It can be useful for when the lines are changing often due to rapid development and such. If OpenAI whisper fails to load this will be replaced with a placeholder.
68+
**OPTIONAL** | The actual subtitle that will be shown when this scene plays. If not specified, will be replaced with a placeholder.
6969

7070
#### "cc_color" "255,255,255"
7171
**OPTIONAL** | The color of the whole line. If not specified defaults to white.

requirements_optional.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
openai-whisper >= 20250625

src/template_class.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,6 @@
1515

1616
PLACEHOLDER_TEXT = "CCAutoVCD: No subtitle specified!"
1717

18-
TRANSCRIBER = None
19-
20-
def TryLoadWhisper(model: str):
21-
LOGGER.Info(f"Trying to load auto transcriber: OpenAI-Whisper: {model}")
22-
try:
23-
import whisper
24-
except ImportError:
25-
LOGGER.Warning("Failed! Auto transcription is not possible!")
26-
return False
27-
28-
global TRANSCRIBER
29-
TRANSCRIBER = whisper.load_model(model)
30-
LOGGER.Info("Loaded!")
31-
return True
32-
3318

3419
class SndscriptTemplate:
3520
def __init__(self, kv: Keyvalues, ctx):
@@ -52,14 +37,8 @@ def __init__(self, kv: Keyvalues, ctx):
5237
try:
5338
self.cc = kv["cc"]
5439
except:
55-
# Auto transcription
56-
LOGGER.VInfo(f"Soundscript {self.name} called for auto transcribing.")
57-
if not TRANSCRIBER:
58-
if not TryLoadWhisper("small"):
59-
self.cc = PLACEHOLDER_TEXT
60-
61-
62-
self.cc = TRANSCRIBER.transcribe(str(self.ctx.sound / self.wave))["text"]
40+
LOGGER.Warning(f"Soundscript {self.name} has no subtitle!")
41+
self.cc = PLACEHOLDER_TEXT
6342

6443
try:
6544
self.map = kv["map"]

0 commit comments

Comments
 (0)