data/voice/voice_service library

Voice mode service for the Flutter client.

Migrated from the Neomage TypeScript voice/ module. Provides:

  • VoiceState enum (idle / recording / processing)
  • VoiceMode toggle state
  • Language normalization for speech-to-text
  • Feature-flag and auth gating (simplified — no GrowthBook dependency)

The service is provider-agnostic: callers supply their own STT/TTS implementation via VoiceServiceConfig.

Classes

SttLanguageResult
Result of normalizeLanguageForSTT.
VoiceService
Provider-agnostic voice mode service.
VoiceServiceConfig
Callback signatures for provider-agnostic voice operations.
VoiceToggleError
Voice mode could not be toggled.
VoiceToggleResult
Outcome of a voice-mode toggle attempt.
VoiceToggleSuccess
Voice mode was successfully toggled.

Enums

VoiceState
Current phase of a voice interaction.

Functions

normalizeLanguageForSTT(String? language) SttLanguageResult
Normalize a language preference string to a BCP-47 code supported by the voice-stream STT endpoint.