TranscriptionService hardcodes Android SpeechRecognizer — backend abstraction layer is entirely dead code #3

Closed
opened 2026-05-13 05:37:57 +00:00 by Mark · 1 comment
Owner

Problem

TranscriptionService.startTranscription() (lines 93-167) directly creates SpeechRecognizer.createSpeechRecognizer(this) and never calls SpeechBackend.select(). The entire provider abstraction layer (TranscriptionProvider interface, SpeechBackend selection logic, CloudTranscriptionProvider, FireOSTranscriptionProvider) is unreachable at runtime. This is the root cause that makes all non-Android backends dead code.

Location

  • app/src/main/java/com/voicetranscriber/service/TranscriptionService.kt (lines 93-167, 169-186)
  • app/src/main/java/com/voicetranscriber/service/SpeechBackend.kt (lines 97-122)

Suggested approach

  1. startTranscription() should call SpeechBackend.select() at startup to pick the best available backend
  2. Create the appropriate TranscriptionProvider implementation based on the selection
  3. Wire the provider's listener callbacks (onResult, onPartialResult, onError) into the existing service state flows
  4. For CLOUD backend specifically: run a coroutine loop on Dispatchers.IO calling CloudTranscriptionProvider.recordAndTranscribe()
  5. For ANDROID/FIREOS: route through AndroidTranscriptionProvider or FireOSTranscriptionProvider
  6. Read BackendConfig from SharedPreferences at service startup

This is a prerequisite for issues #1 and #2 to have any effect at runtime.

## Problem TranscriptionService.startTranscription() (lines 93-167) directly creates SpeechRecognizer.createSpeechRecognizer(this) and never calls SpeechBackend.select(). The entire provider abstraction layer (TranscriptionProvider interface, SpeechBackend selection logic, CloudTranscriptionProvider, FireOSTranscriptionProvider) is unreachable at runtime. This is the root cause that makes all non-Android backends dead code. ## Location - app/src/main/java/com/voicetranscriber/service/TranscriptionService.kt (lines 93-167, 169-186) - app/src/main/java/com/voicetranscriber/service/SpeechBackend.kt (lines 97-122) ## Suggested approach 1. startTranscription() should call SpeechBackend.select() at startup to pick the best available backend 2. Create the appropriate TranscriptionProvider implementation based on the selection 3. Wire the provider's listener callbacks (onResult, onPartialResult, onError) into the existing service state flows 4. For CLOUD backend specifically: run a coroutine loop on Dispatchers.IO calling CloudTranscriptionProvider.recordAndTranscribe() 5. For ANDROID/FIREOS: route through AndroidTranscriptionProvider or FireOSTranscriptionProvider 6. Read BackendConfig from SharedPreferences at service startup This is a prerequisite for issues #1 and #2 to have any effect at runtime.
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark 2026-05-13 19:43:05 +00:00
Sign in to join this conversation.
No description provided.