Full sync - all projects, memory, configs
This commit is contained in:
18
tools/whisper-transcribe.py
Executable file
18
tools/whisper-transcribe.py
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Whisper transcription wrapper for OpenClaw voice notes.
|
||||
Outputs transcript text to stdout."""
|
||||
|
||||
import sys
|
||||
|
||||
def transcribe(path):
|
||||
from faster_whisper import WhisperModel
|
||||
model = WhisperModel("base.en", device="cpu", compute_type="int8")
|
||||
segments, _ = model.transcribe(path, beam_size=5, language="en")
|
||||
text = " ".join(seg.text for seg in segments).strip()
|
||||
print(text)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: whisper-transcribe.py <audio-file>", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
transcribe(sys.argv[-1])
|
||||
Reference in New Issue
Block a user