Skip to content

Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.

feat(speech): setting to stop reading voice-message replies aloud

Durganshuef198b94f896
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fa969ce..9f26ec7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,12 @@ All notable changes to Gotcha are documented here.
## [Unreleased]
### Added
+- **Dictate without the reply being read aloud** (#118). A new Speech setting,
+ "Read aloud replies to voice messages", decides whether the reply to a message
+ you sent with the microphone is spoken. It is on by default, so nothing
+ changes until you turn it off; then voice messages behave like typed ones and
+ are only read aloud when "Auto-read replies aloud" is on. The speaker icon
+ still reads any reply on demand.
- **Tasks keep running when you leave Gotcha** (#105). While Gotcha works on a
task, a quiet "Gotcha is working on …" notification now keeps it running, so
Android no longer closes it to free memory when you switch to another app mid
diff --git a/app/src/main/java/com/gotcha/agent/ChatRunner.kt b/app/src/main/java/com/gotcha/agent/ChatRunner.kt
index 9b0f6a7..1300408 100644
--- a/app/src/main/java/com/gotcha/agent/ChatRunner.kt
+++ b/app/src/main/java/com/gotcha/agent/ChatRunner.kt
@@ -813,9 +813,9 @@ class ChatRunner(private val app: Application) : AgentEvents {
override fun onAssistantReply(text: String) {
signalReplyArrived()
- val shouldRead = currentRunIsVoice ||
- (settings.autoReadReplies && settings.ttsProvider != AudioProvider.NONE)
- if (shouldRead && settings.ttsProvider != AudioProvider.NONE) {
+ val shouldRead = settings.ttsProvider != AudioProvider.NONE &&
+ (settings.autoReadReplies || (currentRunIsVoice && settings.autoReadVoiceReplies))
+ if (shouldRead) {
speak(text)
}
currentRunIsVoice = false
diff --git a/app/src/main/java/com/gotcha/data/SettingsRepository.kt b/app/src/main/java/com/gotcha/data/SettingsRepository.kt
index fb0a813..41cbfff 100644
--- a/app/src/main/java/com/gotcha/data/SettingsRepository.kt
+++ b/app/src/main/java/com/gotcha/data/SettingsRepository.kt
@@ -154,6 +154,12 @@ data class Settings(
val sttApiModel: String = "",
val sttLanguage: String = "",
val autoReadReplies: Boolean = false,
+ /**
+ * Speak the reply to a message sent by voice even when [autoReadReplies] is
+ * off. On by default; off for people who dictate where the reply shouldn't
+ * be heard.
+ */
+ val autoReadVoiceReplies: Boolean = true,
/**
* Buzz when a reply arrives. On by default: a reply can land while the user
* is in another app, and the pattern is distinct from the error buzz so it
@@ -614,6 +620,7 @@ class SettingsRepository(context: Context) : SettingsStore {
sttApiModel = string(KEY_STT_API_MODEL),
sttLanguage = string(KEY_STT_LANGUAGE),
autoReadReplies = prefs.getBoolean(KEY_AUTO_READ, false),
+ autoReadVoiceReplies = prefs.getBoolean(KEY_AUTO_READ_VOICE, true),
notifyVibrationEnabled = prefs.getBoolean(KEY_NOTIFY_VIBRATION, true),
notifyChimeEnabled = prefs.getBoolean(KEY_NOTIFY_CHIME, false),
chatCompletionNotificationsEnabled = prefs.getBoolean(KEY_CHAT_COMPLETION_NOTIFICATIONS, true),
@@ -706,6 +713,7 @@ class SettingsRepository(context: Context) : SettingsStore {
.putString(KEY_STT_API_MODEL, settings.sttApiModel)
.putString(KEY_STT_LANGUAGE, settings.sttLanguage)
.putBoolean(KEY_AUTO_READ, settings.autoReadReplies)
+ .putBoolean(KEY_AUTO_READ_VOICE, settings.autoReadVoiceReplies)
.putBoolean(KEY_NOTIFY_VIBRATION, settings.notifyVibrationEnabled)
.putBoolean(KEY_NOTIFY_CHIME, settings.notifyChimeEnabled)
.putBoolean(KEY_CHAT_COMPLETION_NOTIFICATIONS, settings.chatCompletionNotificationsEnabled)
@@ -837,6 +845,7 @@ class SettingsRepository(context: Context) : SettingsStore {
const val KEY_STT_API_MODEL = "stt_api_model"
const val KEY_STT_LANGUAGE = "stt_language"
const val KEY_AUTO_READ = "auto_read"
+ const val KEY_AUTO_READ_VOICE = "auto_read_voice"
const val KEY_NOTIFY_VIBRATION = "notify_vibration"
const val KEY_NOTIFY_CHIME = "notify_chime"
const val KEY_CHAT_COMPLETION_NOTIFICATIONS = "chat_completion_notifications"
diff --git a/app/src/main/java/com/gotcha/tools/GotchaSettingsUpdate.kt b/app/src/main/java/com/gotcha/tools/GotchaSettingsUpdate.kt
index 285d3c6..bde043f 100644
--- a/app/src/main/java/com/gotcha/tools/GotchaSettingsUpdate.kt
+++ b/app/src/main/java/com/gotcha/tools/GotchaSettingsUpdate.kt
@@ -271,6 +271,13 @@ object GotchaSettingsUpdate {
{ it.autoReadReplies },
{ s, v -> s.copy(autoReadReplies = v) }
),
+ boolSpec(
+ "auto_read_voice_replies",
+ "Read replies to voice messages aloud, even when auto-read is off",
+ setOf(SettingImpact.PRIVACY),
+ { it.autoReadVoiceReplies },
+ { s, v -> s.copy(autoReadVoiceReplies = v) }
+ ),
choiceSpec(
"reply_language",
"Reply language",
diff --git a/app/src/main/java/com/gotcha/ui/SettingsSearchEntry.kt b/app/src/main/java/com/gotcha/ui/SettingsSearchEntry.kt
index cf4097b..4b9693b 100644
--- a/app/src/main/java/com/gotcha/ui/SettingsSearchEntry.kt
+++ b/app/src/main/java/com/gotcha/ui/SettingsSearchEntry.kt
@@ -184,7 +184,12 @@ private fun entryFor(page: SettingsPage): SettingsSearchEntry = when (page) {
R.string.settings_field_stt_provider,
"stt, transcription, transcribe, speech to text"
),
- field("settings_auto_read_replies", R.string.settings_field_auto_read_replies, "read aloud, read replies")
+ field("settings_auto_read_replies", R.string.settings_field_auto_read_replies, "read aloud, read replies"),
+ field(
+ "settings_auto_read_voice_replies",
+ R.string.settings_field_auto_read_voice_replies,
+ "voice replies, microphone, mic, dictation, dictate"
+ )
)
)
SettingsPage.PERMISSIONS -> SettingsSearchEntry(
diff --git a/app/src/main/java/com/gotcha/ui/SpeechScreen.kt b/app/src/main/java/com/gotcha/ui/SpeechScreen.kt
index c1bf89f..6ce2b09 100644
--- a/app/src/main/java/com/gotcha/ui/SpeechScreen.kt
+++ b/app/src/main/java/com/gotcha/ui/SpeechScreen.kt
@@ -85,6 +85,7 @@ fun SpeechScreen(
var sttApiKey by remember { mutableStateOf(initial.sttApiKey) }
var sttApiModel by remember { mutableStateOf(initial.sttApiModel) }
var autoReadReplies by remember { mutableStateOf(initial.autoReadReplies) }
+ var autoReadVoiceReplies by remember { mutableStateOf(initial.autoReadVoiceReplies) }
// Samosa auth state, kept live as the user signs in / out.
var samosaToken by remember { mutableStateOf(initial.samosaSessionToken) }
var samosaEmail by remember { mutableStateOf(initial.samosaEmail) }
@@ -139,7 +140,8 @@ fun SpeechScreen(
sttApiBaseUrl = sttApiBaseUrl.trim(),
sttApiKey = sttApiKey.trim(),
sttApiModel = sttApiModel.trim(),
- autoReadReplies = autoReadReplies
+ autoReadReplies = autoReadReplies,
+ autoReadVoiceReplies = autoReadVoiceReplies
)
/** As stored, plus the unsaved edits — audio-model discovery needs both. */
@@ -536,6 +538,15 @@ fun SpeechScreen(
isLarge = true,
switchTestTag = "settings_auto_read_replies"
)
+ // Moot while every reply is read aloud anyway.
+ SettingsToggleRow(
+ label = stringResource(R.string.speech_auto_read_voice_replies),
+ checked = autoReadVoiceReplies || autoReadReplies,
+ onCheckedChange = { autoReadVoiceReplies = it },
+ isLarge = true,
+ enabled = !autoReadReplies,
+ switchTestTag = "settings_auto_read_voice_replies"
+ )
Button(
onClick = {
onSave { applySpeech(it) }
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 11a6504..419661c 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -108,6 +108,7 @@
<string name="settings_field_api_timeout">API-Zeitlimit</string>
<string name="settings_field_tts_provider">TTS-Anbieter</string>
<string name="settings_field_auto_read_replies">Antworten automatisch vorlesen</string>
+ <string name="settings_field_auto_read_voice_replies">Antworten auf Sprachnachrichten vorlesen</string>
<string name="settings_field_proactive_enabled">Proaktive Vorschläge</string>
<string name="settings_field_proactive_scan_screen">Bildschirminhalt scannen</string>
<string name="settings_field_proactive_scan_clipboard">Zwischenablage scannen</string>
@@ -206,6 +207,7 @@
<string name="speech_podcast_host_a_voice_optional">Stimme für Podcast-Host A (optional)</string>
<string name="speech_podcast_host_b_voice_optional">Stimme für Podcast-Host B (optional)</string>
<string name="speech_auto_read_replies_aloud">Antworten automatisch vorlesen</string>
+ <string name="speech_auto_read_voice_replies">Antworten auf Sprachnachrichten vorlesen</string>
<string name="speech_how_to_choose_a_voice">So wählst du Stimme und Sprache (Samosa-AI-Doku)</string>
<string name="speech_for_mixed_language_text_like">Für gemischtsprachigen Text (wie Hinglish) wird Android built-in empfohlen. Für eine einzelne Sprache (wie Hindi oder Englisch) wird SAMOSA AI empfohlen.</string>
<string name="speech_podcast_hosts_the_two_voices">Podcast-Hosts – die zwei Stimmen, die genutzt werden, wenn der Assistent einen Podcast-Dialog mit zwei Hosts erstellt. Leer lassen, um für Host A die TTS-Stimme und für Host B automatisch eine andere Stimme zu nutzen.</string>
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 25b99e6..7aadfe3 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -108,6 +108,7 @@
<string name="settings_field_api_timeout">Tiempo de espera de la API</string>
<string name="settings_field_tts_provider">Proveedor de TTS</string>
<string name="settings_field_auto_read_replies">Leer respuestas en voz alta automáticamente</string>
+ <string name="settings_field_auto_read_voice_replies">Leer en voz alta las respuestas a mensajes de voz</string>
<string name="settings_field_proactive_enabled">Sugerencias proactivas</string>
<string name="settings_field_proactive_scan_screen">Escanear contenido de la pantalla</string>
<string name="settings_field_proactive_scan_clipboard">Escanear portapapeles</string>
@@ -206,6 +207,7 @@
<string name="speech_podcast_host_a_voice_optional">Voz del presentador A del pódcast (opcional)</string>
<string name="speech_podcast_host_b_voice_optional">Voz del presentador B del pódcast (opcional)</string>
<string name="speech_auto_read_replies_aloud">Leer respuestas en voz alta automáticamente</string>
+ <string name="speech_auto_read_voice_replies">Leer en voz alta las respuestas a mensajes de voz</string>
<string name="speech_how_to_choose_a_voice">Cómo elegir voz e idioma (documentación de Samosa AI)</string>
<string name="speech_for_mixed_language_text_like">Para texto en varios idiomas mezclados (como el hinglish), se recomienda Android built-in. Para voz en un solo idioma (como hindi o inglés), se recomienda SAMOSA AI.</string>
<string name="speech_podcast_hosts_the_two_voices">Presentadores del pódcast: las dos voces que se usan cuando el asistente crea un diálogo de pódcast con dos presentadores. Déjalo vacío para usar la voz de TTS en el presentador A y otra voz elegida automáticamente en el B.</string>
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 5bd787a..f076308 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -108,6 +108,7 @@
<string name="settings_field_api_timeout">Délai d\'expiration de l\'API</string>
<string name="settings_field_tts_provider">Fournisseur TTS</string>
<string name="settings_field_auto_read_replies">Lire les réponses à voix haute automatiquement</string>
+ <string name="settings_field_auto_read_voice_replies">Lire à voix haute les réponses aux messages vocaux</string>
<string name="settings_field_proactive_enabled">Suggestions proactives</string>
<string name="settings_field_proactive_scan_screen">Analyser le contenu de l\'écran</string>
<string name="settings_field_proactive_scan_clipboard">Analyser le presse-papiers</string>
@@ -206,6 +207,7 @@
<string name="speech_podcast_host_a_voice_optional">Voix de l\'animateur A du podcast (facultative)</string>
<string name="speech_podcast_host_b_voice_optional">Voix de l\'animateur B du podcast (facultative)</string>
<string name="speech_auto_read_replies_aloud">Lire les réponses à voix haute automatiquement</string>
+ <string name="speech_auto_read_voice_replies">Lire à voix haute les réponses aux messages vocaux</string>
<string name="speech_how_to_choose_a_voice">Comment choisir une voix et une langue (documentation Samosa AI)</string>
<string name="speech_for_mixed_language_text_like">Pour un texte qui mélange les langues (comme le hinglish), Android built-in est recommandé. Pour une seule langue (comme l\'hindi ou l\'anglais), SAMOSA AI est recommandé.</string>
<string name="speech_podcast_hosts_the_two_voices">Animateurs du podcast : les deux voix utilisées quand l\'assistant crée un dialogue de podcast à deux voix. Laissez vide pour utiliser la voix TTS pour l\'animateur A et une autre voix choisie automatiquement pour l\'animateur B.</string>
diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml
index 2f07197..fa137a3 100644
--- a/app/src/main/res/values-hi/strings.xml
+++ b/app/src/main/res/values-hi/strings.xml
@@ -108,6 +108,7 @@
<string name="settings_field_api_timeout">API टाइमआउट</string>
<string name="settings_field_tts_provider">TTS प्रदाता</string>
<string name="settings_field_auto_read_replies">जवाब अपने-आप ज़ोर से पढ़ें</string>
+ <string name="settings_field_auto_read_voice_replies">वॉइस मैसेज के जवाब पढ़कर सुनाएँ</string>
<string name="settings_field_proactive_enabled">सक्रिय सुझाव</string>
<string name="settings_field_proactive_scan_screen">स्क्रीन की सामग्री स्कैन करें</string>
<string name="settings_field_proactive_scan_clipboard">क्लिपबोर्ड स्कैन करें</string>
@@ -206,6 +207,7 @@
<string name="speech_podcast_host_a_voice_optional">पॉडकास्ट होस्ट A की आवाज़ (वैकल्पिक)</string>
<string name="speech_podcast_host_b_voice_optional">पॉडकास्ट होस्ट B की आवाज़ (वैकल्पिक)</string>
<string name="speech_auto_read_replies_aloud">जवाब अपने-आप ज़ोर से पढ़ें</string>
+ <string name="speech_auto_read_voice_replies">वॉइस मैसेज के जवाब पढ़कर सुनाएँ</string>
<string name="speech_how_to_choose_a_voice">आवाज़ और भाषा कैसे चुनें (Samosa AI दस्तावेज़)</string>
<string name="speech_for_mixed_language_text_like">मिली-जुली भाषा वाले टेक्स्ट (जैसे Hinglish) के लिए Android built-in सुझाया जाता है। एक ही भाषा की बोली (जैसे हिन्दी या अंग्रेज़ी) के लिए SAMOSA AI सुझाया जाता है।</string>
<string name="speech_podcast_hosts_the_two_voices">पॉडकास्ट होस्ट — जब असिस्टेंट दो होस्ट वाला पॉडकास्ट संवाद बनाता है, तब इस्तेमाल होने वाली दो आवाज़ें। खाली छोड़ें तो होस्ट A के लिए TTS आवाज़ और होस्ट B के लिए अपने-आप चुनी गई दूसरी आवाज़ इस्तेमाल होगी।</string>
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 555650c..a1d5cfa 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -108,6 +108,7 @@
<string name="settings_field_api_timeout">Timeout API</string>
<string name="settings_field_tts_provider">Fornitore TTS</string>
<string name="settings_field_auto_read_replies">Leggi le risposte ad alta voce automaticamente</string>
+ <string name="settings_field_auto_read_voice_replies">Leggi ad alta voce le risposte ai messaggi vocali</string>
<string name="settings_field_proactive_enabled">Suggerimenti proattivi</string>
<string name="settings_field_proactive_scan_screen">Analizza il contenuto dello schermo</string>
<string name="settings_field_proactive_scan_clipboard">Analizza gli appunti</string>
@@ -206,6 +207,7 @@
<string name="speech_podcast_host_a_voice_optional">Voce del conduttore A del podcast (facoltativa)</string>
<string name="speech_podcast_host_b_voice_optional">Voce del conduttore B del podcast (facoltativa)</string>
<string name="speech_auto_read_replies_aloud">Leggi le risposte ad alta voce automaticamente</string>
+ <string name="speech_auto_read_voice_replies">Leggi ad alta voce le risposte ai messaggi vocali</string>
<string name="speech_how_to_choose_a_voice">Come scegliere voce e lingua (documentazione Samosa AI)</string>
<string name="speech_for_mixed_language_text_like">Per testi in più lingue mescolate (come l\'hinglish) è consigliato Android built-in. Per una sola lingua (come hindi o inglese) è consigliato SAMOSA AI.</string>
<string name="speech_podcast_hosts_the_two_voices">Conduttori del podcast: le due voci usate quando l\'assistente crea un dialogo da podcast a due voci. Lascia vuoto per usare la voce TTS per il conduttore A e un\'altra voce scelta automaticamente per il conduttore B.</string>
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index af23b28..d13bf42 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -108,6 +108,7 @@
<string name="settings_field_api_timeout">API タイムアウト</string>
<string name="settings_field_tts_provider">TTS プロバイダ</string>
<string name="settings_field_auto_read_replies">回答を自動で読み上げる</string>
+ <string name="settings_field_auto_read_voice_replies">音声メッセージへの返信を読み上げる</string>
<string name="settings_field_proactive_enabled">先回りの提案</string>
<string name="settings_field_proactive_scan_screen">画面の内容をスキャン</string>
<string name="settings_field_proactive_scan_clipboard">クリップボードをスキャン</string>
@@ -206,6 +207,7 @@
<string name="speech_podcast_host_a_voice_optional">ポッドキャスト ホスト A の音声 (任意)</string>
<string name="speech_podcast_host_b_voice_optional">ポッドキャスト ホスト B の音声 (任意)</string>
<string name="speech_auto_read_replies_aloud">回答を自動で読み上げる</string>
+ <string name="speech_auto_read_voice_replies">音声メッセージへの返信を読み上げる</string>
<string name="speech_how_to_choose_a_voice">音声と言語の選び方 (Samosa AI ドキュメント)</string>
<string name="speech_for_mixed_language_text_like">ヒングリッシュのように複数の言語が混ざった文章には Android built-in をおすすめします。ヒンディー語や英語など単一の言語には SAMOSA AI をおすすめします。</string>
<string name="speech_podcast_hosts_the_two_voices">ポッドキャストのホスト: アシスタントが 2 人の声でポッドキャスト風の対話を作るときに使う音声です。空欄にすると、ホスト A には TTS の音声、ホスト B には自動で選んだ別の音声を使います。</string>
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 8807ab8..4ccef78 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -108,6 +108,7 @@
<string name="settings_field_api_timeout">Tempo limite da API</string>
<string name="settings_field_tts_provider">Provedor de TTS</string>
<string name="settings_field_auto_read_replies">Ler respostas em voz alta automaticamente</string>
+ <string name="settings_field_auto_read_voice_replies">Ler em voz alta as respostas a mensagens de voz</string>
<string name="settings_field_proactive_enabled">Sugestões proativas</string>
<string name="settings_field_proactive_scan_screen">Analisar o conteúdo da tela</string>
<string name="settings_field_proactive_scan_clipboard">Analisar a área de transferência</string>
@@ -206,6 +207,7 @@
<string name="speech_podcast_host_a_voice_optional">Voz do apresentador A do podcast (opcional)</string>
<string name="speech_podcast_host_b_voice_optional">Voz do apresentador B do podcast (opcional)</string>
<string name="speech_auto_read_replies_aloud">Ler respostas em voz alta automaticamente</string>
+ <string name="speech_auto_read_voice_replies">Ler em voz alta as respostas a mensagens de voz</string>
<string name="speech_how_to_choose_a_voice">Como escolher voz e idioma (documentação da Samosa AI)</string>
<string name="speech_for_mixed_language_text_like">Para textos que misturam idiomas (como o hinglish), o Android built-in é recomendado. Para um único idioma (como híndi ou inglês), a SAMOSA AI é recomendada.</string>
<string name="speech_podcast_hosts_the_two_voices">Apresentadores do podcast: as duas vozes usadas quando o assistente cria um diálogo de podcast com duas vozes. Deixe em branco para usar a voz de TTS no apresentador A e outra voz escolhida automaticamente no apresentador B.</string>
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 914df2f..d6e178d 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -108,6 +108,7 @@
<string name="settings_field_api_timeout">API 超时</string>
<string name="settings_field_tts_provider">TTS 提供商</string>
<string name="settings_field_auto_read_replies">自动朗读回复</string>
+ <string name="settings_field_auto_read_voice_replies">朗读语音消息的回复</string>
<string name="settings_field_proactive_enabled">主动建议</string>
<string name="settings_field_proactive_scan_screen">扫描屏幕内容</string>
<string name="settings_field_proactive_scan_clipboard">扫描剪贴板</string>
@@ -206,6 +207,7 @@
<string name="speech_podcast_host_a_voice_optional">播客主持人 A 的声音(可选)</string>
<string name="speech_podcast_host_b_voice_optional">播客主持人 B 的声音(可选)</string>
<string name="speech_auto_read_replies_aloud">自动朗读回复</string>
+ <string name="speech_auto_read_voice_replies">朗读语音消息的回复</string>
<string name="speech_how_to_choose_a_voice">如何选择声音和语言(Samosa AI 文档)</string>
<string name="speech_for_mixed_language_text_like">对于混合多种语言的文本(如印式英语),推荐使用 Android built-in。对于单一语言(如印地语或英语),推荐使用 SAMOSA AI。</string>
<string name="speech_podcast_hosts_the_two_voices">播客主持人:助手制作双人播客对话时使用的两个声音。留空则主持人 A 使用 TTS 声音,主持人 B 自动选择另一个声音。</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ac4b494..5bd73df 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -143,6 +143,7 @@
<string name="settings_field_api_timeout">API timeout</string>
<string name="settings_field_tts_provider">TTS provider</string>
<string name="settings_field_auto_read_replies">Auto-read replies aloud</string>
+ <string name="settings_field_auto_read_voice_replies">Read aloud replies to voice messages</string>
<string name="settings_field_proactive_enabled">Proactive offers</string>
<string name="settings_field_proactive_scan_screen">Scan screen content</string>
<string name="settings_field_proactive_scan_clipboard">Scan clipboard</string>
@@ -259,6 +260,7 @@
<string name="speech_podcast_host_a_voice_optional">Podcast Host A Voice (optional)</string>
<string name="speech_podcast_host_b_voice_optional">Podcast Host B Voice (optional)</string>
<string name="speech_auto_read_replies_aloud">Auto-read replies aloud</string>
+ <string name="speech_auto_read_voice_replies">Read aloud replies to voice messages</string>
<string name="speech_how_to_choose_a_voice">How to choose a voice and language (Samosa AI docs)</string>
<string name="speech_for_mixed_language_text_like">For mixed-language text (like Hinglish), Android built-in is the recommended choice. For single-language speech (like Hindi or English), SAMOSA AI is the recommended choice.</string>
<string name="speech_podcast_hosts_the_two_voices">Podcast hosts — the two voices used when the assistant generates a two-host podcast dialogue. Leave blank to use the TTS voice for host A and an automatically chosen different voice for host B.</string>
diff --git a/app/src/test/java/com/gotcha/agent/ChatViewModelAutoReadTest.kt b/app/src/test/java/com/gotcha/agent/ChatViewModelAutoReadTest.kt
index e85eced..5c9a88d 100644
--- a/app/src/test/java/com/gotcha/agent/ChatViewModelAutoReadTest.kt
+++ b/app/src/test/java/com/gotcha/agent/ChatViewModelAutoReadTest.kt
@@ -7,6 +7,7 @@ import com.gotcha.data.LlmProvider
import com.gotcha.data.Settings
import com.gotcha.data.SettingsRepository
import com.gotcha.testsupport.FakeAndroidKeyStore
+import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
@@ -63,6 +64,37 @@ class ChatViewModelAutoReadTest {
assertFalse(viewModel.uiState.value.isSpeaking)
}
+ @Test
+ fun `voice message when autoReadVoiceReplies is off stays silent`() {
+ applySettings { it.copy(autoReadVoiceReplies = false) }
+ viewModel.sendMessage("Hello", isVoiceInput = true)
+ viewModel.runner.onAssistantReply("Hello back!")
+ assertFalse(viewModel.uiState.value.isSpeaking)
+ }
+
+ @Test
+ fun `voice message when autoReadVoiceReplies is off still speaks when autoReadReplies is on`() {
+ applySettings { it.copy(autoReadVoiceReplies = false, autoReadReplies = true) }
+ viewModel.sendMessage("Hello", isVoiceInput = true)
+ viewModel.runner.onAssistantReply("Hello back!")
+ assertTrue(viewModel.uiState.value.isSpeaking)
+ }
+
+ @Test
+ fun `typed message when autoReadReplies is on speaks regardless of autoReadVoiceReplies`() {
+ applySettings { it.copy(autoReadVoiceReplies = false, autoReadReplies = true) }
+ viewModel.sendMessage("Hello", isVoiceInput = false)
+ viewModel.runner.onAssistantReply("Hello back!")
+ assertTrue(viewModel.uiState.value.isSpeaking)
+ }
+
+ @Test
+ fun `autoReadVoiceReplies round-trips and defaults to on for installs that never saved it`() {
+ assertTrue(settingsRepository.load().autoReadVoiceReplies)
+ applySettings { it.copy(autoReadVoiceReplies = false) }
+ assertEquals(false, settingsRepository.load().autoReadVoiceReplies)
+ }
+
@Test
fun `opening session clears any voice input flag`() {
viewModel.sendMessage("Hello", isVoiceInput = true)
@@ -72,4 +104,9 @@ class ChatViewModelAutoReadTest {
viewModel.runner.onAssistantReply("Session reply")
assertFalse(viewModel.uiState.value.isSpeaking)
}
+
+ private fun applySettings(change: (Settings) -> Settings) {
+ settingsRepository.save(change(settingsRepository.load()))
+ viewModel.runner.refreshSettings()
+ }
}
diff --git a/app/src/test/java/com/gotcha/agent/SettingsUpdateLoopTest.kt b/app/src/test/java/com/gotcha/agent/SettingsUpdateLoopTest.kt
index 40ae7d4..5708815 100644
--- a/app/src/test/java/com/gotcha/agent/SettingsUpdateLoopTest.kt
+++ b/app/src/test/java/com/gotcha/agent/SettingsUpdateLoopTest.kt
@@ -163,6 +163,17 @@ class SettingsUpdateLoopTest {
assertTrue(repository.load().autoReadReplies)
}
+ @Test
+ fun `the voice-reply read-aloud toggle can be turned off`() = runTest {
+ enqueueSettingsCall("""{"auto_read_voice_replies":false}""")
+ enqueueTextReply("Done.")
+
+ engine.run(AgentMode.OPERATOR)
+
+ assertEquals(1, events.confirmationRequests.size)
+ assertFalse(repository.load().autoReadVoiceReplies)
+ }
+
@Test
fun `an invalid request is refused before any prompt and changes nothing`() = runTest {
val before = repository.load()
diff --git a/app/src/test/java/com/gotcha/ui/SettingsSearchEntryTest.kt b/app/src/test/java/com/gotcha/ui/SettingsSearchEntryTest.kt
index 14eb833..d302c41 100644
--- a/app/src/test/java/com/gotcha/ui/SettingsSearchEntryTest.kt
+++ b/app/src/test/java/com/gotcha/ui/SettingsSearchEntryTest.kt
@@ -118,6 +118,10 @@ class SettingsSearchEntryTest {
assertEquals("settings_proactive_otp", fieldFor("otp", SettingsPage.PROACTIVE)?.testTag)
assertEquals("settings_wake_word", fieldFor("wake word", SettingsPage.ASSISTIVE_BALL)?.testTag)
assertEquals("settings_auto_read_replies", fieldFor("read aloud", SettingsPage.SPEECH)?.testTag)
+ assertEquals(
+ "settings_auto_read_voice_replies",
+ fieldFor("microphone", SettingsPage.SPEECH)?.testTag
+ )
}
@Test
diff --git a/docs/RUNNING.md b/docs/RUNNING.md
index 9886d7b..3b4587d 100644
--- a/docs/RUNNING.md
+++ b/docs/RUNNING.md
@@ -259,8 +259,13 @@ current mode via the system prompt on every API call.
A microphone button next to the input field lets you speak instead of type (Speech-to-Text).
Each assistant message has a speaker icon to read it aloud (Text-to-Speech). Configure
-the provider (Android built-in vs OpenAI-compatible API) in Settings. An auto-read toggle
-speaks new replies automatically.
+the provider (Android built-in vs OpenAI-compatible API) in Settings. Two toggles decide
+which replies are spoken automatically:
+
+- **Auto-read replies aloud** (off by default) speaks every new reply.
+- **Read aloud replies to voice messages** (on by default) speaks the reply to a message
+ you sent with the microphone, even when auto-read is off. Turn it off to dictate
+ quietly; the speaker icon still reads any reply on demand.
### Image reading