Extract duplicated code (Whisper loading, audio recording, transcription, VAD processing) into reusable sttlib/ package. Rewrite all 3 scripts as thin wrappers. Add 24 unit tests with mocked hardware. Fix GPU fallback bug in assistant.py and args.system assignment bug.
8 lines
359 B
Python
8 lines
359 B
Python
from sttlib.whisper_loader import load_whisper_model
|
|
from sttlib.audio import record_until_enter, pcm_bytes_to_float32
|
|
from sttlib.transcription import transcribe, is_hallucination, HALLUCINATION_PATTERNS
|
|
from sttlib.vad import (
|
|
VADProcessor, audio_callback, audio_queue,
|
|
SAMPLE_RATE, CHANNELS, FRAME_DURATION_MS, FRAME_SIZE, MIN_UTTERANCE_FRAMES,
|
|
)
|