injectTranscript
Injects synthetic STT transcripts into a live simulator to drive voice handlers, enabling automated end-to-end voice-flow testing without a human in the loop.
Instructions
Inject a synthetic STT transcript into a live simulator session, the same way the simulator browser tab's click-to-fire chips do. Closes the agent-driven end-to-end test loop: after createSimulatorSession returns and your app attaches, call this with the wake phrase text to drive your voice handler — no human in the loop. Frame travels through the same hub path as a real browser click, so handler dispatch + event-log entries (visible via getEventLog) are identical. Drives the glasses.voice.onPhrase matcher: a wake-phrase match dispatches the handler exactly as a real utterance would. USE for automated voice-flow validation (createSimulatorSession → injectTranscript → getEventLog). DON'T USE for static validation (use validateIntegration) or capability discovery (use getPlatformInfo). See getCodeExample(pattern: 'agent_driven_e2e_full_loop') for the full agent-driven recipe.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The transcript text to inject. For wake-phrase tests, pass the exact phrase your onPhrase / transcriptions matcher expects (case-insensitive substring match — "start recording" matches "please start recording now"). | |
| isFinal | No | When true (default for type=stt_transcript), the frame is a final transcript that fires onPhrase matchers. When false, it's a partial — most matchers wait for finals, but the simulator UI + live-captions consumers see both. | |
| partial | No | Convenience: when true, send as stt_partial (a not-yet-final transcript). Sets isFinal=false by default. Use for testing live-captions UI that consumes partials. | |
| sessionId | Yes | ||
| confidence | No | STT confidence value (0-1). Defaults to 0.99 to match the manual_trigger semantics the simulator's click-to-fire uses. |