The chat's microphone follows Settings › Voice input, as the assistant does
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
usePhoneRecognizer() is the one rule for both: the phone's recogniser when it was chosen and the phone has one (or the instance has no speech-to-text), otherwise the instance's. With the phone's, the words go into the box as they are said. The setting's explanation now names both users. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
16 files changed
+97
-32
No files matched your search
@@ -8,6 +8,8 @@ import eu.llembas.android.assist.AssistTurn
|
||||
import eu.llembas.android.assist.Recorder
|
||||
import eu.llembas.android.assist.SheetStop
|
||||
import eu.llembas.android.assist.settle
|
||||
import eu.llembas.android.assist.usePhoneRecognizer
|
||||
import eu.llembas.android.auth.Prefs
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
@@ -73,4 +75,16 @@ class AssistTest {
|
||||
}
|
||||
assertTrue(Recorder.rms(loud, loud.size) > 0.9f)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun voiceInputChoosesTheSameRecogniserForTheAssistantAndTheChat() {
|
||||
// Chosen and present: the phone's.
|
||||
assertTrue(usePhoneRecognizer(Prefs.VOICE_PHONE, phoneHas = true, instanceStt = null))
|
||||
// Chosen but absent: the instance's, whatever it said.
|
||||
assertFalse(usePhoneRecognizer(Prefs.VOICE_PHONE, phoneHas = false, instanceStt = false))
|
||||
// LLeMbas chosen: the instance's, unless it said it has no speech-to-text.
|
||||
assertFalse(usePhoneRecognizer(Prefs.VOICE_LEMBAS, phoneHas = true, instanceStt = null))
|
||||
assertFalse(usePhoneRecognizer(Prefs.VOICE_LEMBAS, phoneHas = true, instanceStt = true))
|
||||
assertTrue(usePhoneRecognizer(Prefs.VOICE_LEMBAS, phoneHas = true, instanceStt = false))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user