Service Layer medium complexity mobile
0
Dependencies
2
Dependents
0
Entities
0
Integrations

Description

Flutter service that wraps the speech_to_text plugin, abstracting iOS SFSpeechRecognizer and Android SpeechRecognizer behind a single async API. Performs transcription on-device where the platform supports it and falls back to a cloud STT API (with explicit user consent) where it does not. No audio is persisted - only the final text transcript is emitted.

Feature: Speech-to-Text Input

speech-to-text-service

Responsibilities

  • Initialise and configure the speech_to_text plugin for the host platform
  • Request and track microphone permission state, exposing a stream of permission status
  • Run on-device transcription and emit interim and final result events via streams
  • Invoke cloud STT fallback when on-device recognition is unavailable and consent is granted
  • Clean up resources and stop any active session on dispose or app backgrounding

Interfaces

Future<bool> initialize()
Stream<PermissionStatus> get permissionStatus
Future<void> startListening({required void Function(String interim, bool isFinal) onResult})
Future<void> stopListening()
bool get isAvailable
bool get isListening
Future<void> dispose()

Relationships

Dependents (2)

Components that depend on this component