Documentation Pages
Speech-to-Text & Normalization
Offline voice capture relies on the Vosk Speech-to-Text library running local acoustic models, paired with a custom number normalization algorithm that converts spelled-out numbers into standard numeric arguments.
1. Audio Recording Specification
- Format: 16,000Hz Sample Rate, 16-bit Mono, Linear PCM WAV format.
- Buffer Size: Recorded in chunks on-device, then uploaded as raw WAV files to the backend chatbot router.
2. Word-to-Number Normalization
Speech recognizers generally transcribe numeric arguments as literal words (e.g. "walk forward five steps"). To allow the parser to extract precise integers for gait loops, the backend employs a recursive word-number solver:
def convert_words_to_numbers(text):
# Splits, checks against value dictionary, handles multipliers:
# "two hundred and forty five" -> 245
#
# 1. Matches scale terms: "hundred", "thousand"
# 2. Accumulates totals: tens + units
# 3. Swaps words dynamically within the sentence textVoice Command Data Flow

Vosk STT and Semantic Parsing Data Flow