Use a line with an acronym, a decimal and a pause: ‘Export WAV, wait 2.5 seconds, then generate captions.’ It exposes pronunciation and segmentation errors in a short test. Desktop composition and an open editor already consume part of the card’s 8 GB.
Procedure
-
Prepare a local Piper voice for the target language, its matching configuration and license. Synthesize one WAV on CPU. Listen to the acronym and decimal. The spoken script can spell out ‘two point five’ while the display script retains the digits. Keep sentence IDs for selective regeneration.
-
Transcribe the WAV in a separate faster-whisper process using a local model directory. Start with a small-class model, one input and beam size one. Compare numbers against the reference text. The segments iterator is lazy: transcription finishes when iteration ends.
-
Record nvidia-smi readings before launch, after model loading and during decoding. A startup failure calls for checking driver, CUDA libraries and CTranslate2 compatibility. An out-of-memory error confined to batches points to batch size or other resident software. CPU int8 offers a useful fallback.
from faster_whisper import WhisperModel
model = WhisperModel("./models/asr", device="cuda", compute_type="int8_float16")
segments, info = model.transcribe("line.wav", beam_size=1)
for s in segments:
print(f"{s.start:.2f}..{s.end:.2f} {s.text}")
Produce a playable reference WAV
Use an isolated environment with piper-tts and faster-whisper. List voices with python -m piper.download_voices and choose the intended language. This English voice provides a short installation smoke test. For Chinese narration, choose a Chinese voice with suitable terms.
python -m piper.download_voices en_US-lessac-medium --data-dir ./voices
python -m piper -m en_US-lessac-medium --data-dir ./voices -f line.wav -- "Wait two point five seconds."
Voice download needs a connection on first use. Stage the ONNX file, its matching JSON and a converted CTranslate2 ASR model directory before disconnecting. Listen to line.wav before running the transcription code above.
Choosing an approach
| Route | Budget trade-off | Check |
|---|---|---|
| CPU synthesis + GPU ASR | Separates model residency | Speech and cue boundaries |
| Batched GPU ASR | Higher throughput and peak memory | Peak allocation and omissions |
| CPU int8 ASR | Frees VRAM; measure speed | Isolate GPU setup faults |
Check the result
Align the WAV and recognized cues in an editor. Inspect consonants at the beginning and units at the end of each phrase. Repeat with a much longer passage. Log model revision, compute type, audio duration and elapsed time before estimating production throughput.
Once timings are approved, add the translation with bilingual cue overlap matching.
Frequently asked questions
Can all models stay resident in 8 GB?
That depends on model sizes and batches. Measure each stage separately before deciding to overlap them.
Why does the call return before the captions appear?
Decoding happens while iterating segments. Stop the timer after consumption and verify that segments were emitted.