Skip to content

Repository files navigation

TransI — online-first German ↔ English conversation translator

An Android-only German ↔ English translator designed for long-running, two-person conversations.

microphone → Android speech recognizer → authenticated translation service → text + device TTS
                                             └→ on-device German/English translation when unavailable

The application has no OpenAI key and must never contain one. Online translation is a deliberately separate interface that calls an authenticated service you operate. The device falls back to its local translator when that service is unavailable, times out, or returns an error.

What it does today

  • Kotlin + Jetpack Compose Android app (Android 8 / API 26 or newer).
  • A scrollable conversation timeline with source and translated text grouped into attributed speaker turns.
  • Configurable names for the German- and English-speaking participants.
  • Live conversation mode: listen for a natural utterance, translate it, switch to the other language, and immediately listen for the next turn.
  • Optional Auto voice mode that speaks every translation and resumes live listening only after playback finishes.
  • Direction switch, editable transcript, online-first or offline-only routing, result replay/copy, and up to 100 session-only conversation turns.
  • Push-to-talk recognition with two explicit choices:
    • On-device recognition (default), where Android provides a compatible local recognizer.
    • Phone speech service, selected in Settings when on-device recognition fails. This may send microphone audio to the phone’s configured provider.
  • ML Kit on-device German/English translation backup. Its language-pair model downloads on first use.
  • Android Text-to-Speech, with de-DE or en-US selected to match the result language.
  • Runtime API key storage encrypted by Android Keystore; no key is packaged with the app.

Install and set up

  1. Download the latest app-debug.apk from GitHub Releases.
  2. On the phone, allow the browser or file manager that downloaded it to install unknown apps, then install the APK. New versions can be installed over earlier versions from this project.
  3. Open Settings and enter the API key. The default online model is gpt-5.4-mini; change it only if your gateway supports a different model ID.
  4. For a single turn, hold Hold to speak, review or edit the transcript, then press Translate.
  5. For a flowing two-person exchange, choose the first speaker and press Start live conversation. The app translates after each natural pause and alternates between German and English. Turn on Auto voice to read each result aloud.

Live conversation behaviour

Live mode is hands-free after it starts, but is still turn-based rather than simultaneous. Android's speech recognizer decides when an utterance has ended. Transl then translates that completed text and starts a new recognition turn in the other language. When Auto voice is enabled, microphone recognition stays paused while Text-to-Speech is playing so the app does not transcribe its own output.

Use Swap speaker if the next person is not the automatically selected language side. The conversation remains in memory only and can be cleared from the main screen.

Speaker names and voice identity

Settings allows a name to be assigned to each language side, for example Anna for German and Ben for English. Each conversation turn captures that label when it is created.

This is deterministic attribution, not biometric voice identification. Android's current SpeechRecognizer API returns transcript text but does not expose speaker embeddings or diarized audio segments to this app. Reliable recognition of a particular enrolled person would require a different audio pipeline with speaker diarization plus voice enrollment/verification, explicit consent, secure embedding storage, and an Unknown/ambiguous result. That is feasible as a later feature, but it should not be presented as reliable identity from the current phone recognizer—especially in noisy rooms, with overlapping speech, or with replayed/imitated voices.

The application requests microphone permission the first time it starts. If permission was denied, enable it under the Android app permissions screen and reopen the app.

Speech recognition setup and troubleshooting

Android’s language list and its on-device speech-recognition models are separate system features. Adding German or English as a phone language does not guarantee the phone provides an offline recognizer for it.

The default recognition mode uses Android’s dedicated on-device recognizer. If tapping the microphone immediately reports that on-device speech recognition is unavailable, or that the language is not installed:

  1. Look in the phone’s Language & input, Speech services, or On-device speech recognition settings and download German and English recognition data if the phone provides this option.
  2. If your phone does not offer compatible on-device recognition, open the app’s Settings and enable Use phone speech service instead of on-device recognition.
  3. Save Settings and try again. This option intentionally selects the phone’s normal recognizer; depending on the manufacturer and service, that recognizer may use the network and may send microphone audio to its provider.

If speech recognition still fails, the error message includes the Android cause where the platform exposes it. Typing directly into the transcript box remains a fully supported fallback.

Build

ANDROID_HOME=/opt/android-sdk ./gradlew assembleDebug

The release asset is a debug-signed APK intended for direct sideloading. It is not distributed through Google Play.

Provider choices

Concern First implementation Why
Voice activity detection Android speech recognizer The platform service currently owns utterance boundaries.
ASR Android on-device recognizer, with explicit phone-service fallback Gives the first release microphone input without embedding a large model.
Translation ML Kit on-device translation (de / en) Simple Android delivery and downloadable language models.
TTS Android TextToSpeech with offline downloaded voices No bundled voice model initially; works with phone accessibility settings.
Online translation Configured OpenAI-compatible gateway Preferred path; the credential is entered after installation, not bundled.

ML Kit translation is intentionally the initial local translator, not a claim of best linguistic quality. We will measure it with actual family phrases before adding a larger local NMT model.

Privacy and cloud behaviour

  • Default is Online first, offline backup. Users can choose Offline only before translating.
  • Online translation sends only each finished source transcript and direction—not continuous microphone audio. Live mode does not change this translation boundary.
  • On-device speech recognition keeps microphone audio on-device to the extent guaranteed by the installed Android recognition service. Enabling the explicit phone speech service fallback may send audio to that service’s provider.
  • Do not log transcripts on the proxy by default.
  • The app visibly labels online results and local fallback results, and remains usable without a network connection once offline models are installed.
  • Conversation turns are kept only in memory for the current app session. Delete all local app data clears the encrypted provider credential, settings, transcript, result, and session history.

Online gateway

The app calls the OpenAI-compatible Chat Completions endpoint at https://api.theclawbay.com/v1/chat/completions. Its base URL is intentionally not a secret. The API key is entered after install in Settings and encrypted with an Android Keystore key; it is not kept in source code, Gradle configuration, Android resources, or the APK.

The gateway must accept POST /chat/completions with a bearer credential, model, and chat messages, returning the standard choices[0].message.content response. The app defaults to gpt-5.4-mini, which can be changed in Settings.

See PLAN.md for the staged implementation plan and acceptance criteria.

About

Online-first German-English Android conversation translator

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages