Spoken conversation mode: listen again after each spoken answer until stopped
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
- A spoken question answered aloud opens a conversation (Settings › Assistant, on by default, needs voice replies); after the answer is heard to the end, the sheet listens again. - Ends on a stop phrase (assist_stop_words, per language; isStopPhrase), End, typing, a stopped voice, a card waiting, or nothing said (the existing silence timeout). - "In conversation" banner with End in the sheet's foot; shot 24-assistant-conversation. - HeadsetRoute: a Bluetooth headset made the communication device (Android 12+) and its microphone preferred by the recorder, so the conversation can stay in the ear. - Speaker.playToEnd tells a voice heard to the end from one stopped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
21 files changed
+304
-12
No files matched your search
@@ -7,6 +7,7 @@ import eu.llembas.android.assist.AssistController
|
||||
import eu.llembas.android.assist.AssistTurn
|
||||
import eu.llembas.android.assist.Recorder
|
||||
import eu.llembas.android.assist.SheetStop
|
||||
import eu.llembas.android.assist.isStopPhrase
|
||||
import eu.llembas.android.assist.settle
|
||||
import eu.llembas.android.assist.usePhoneRecognizer
|
||||
import eu.llembas.android.auth.Prefs
|
||||
@@ -96,4 +97,15 @@ class AssistTest {
|
||||
// Files only: the request alone, the files go as attachments.
|
||||
assertEquals("Have a look.", shareMessage(" ", "", "Have a look."))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun stopEndsAConversationButAQuestionAboutStoppingDoesNot() {
|
||||
val phrases = "stop|that's all|goodbye".split("|")
|
||||
assertTrue(isStopPhrase("Stop.", phrases))
|
||||
assertTrue(isStopPhrase("OK, that’s all, thanks", phrases))
|
||||
assertTrue(isStopPhrase("stop please", phrases))
|
||||
assertFalse(isStopPhrase("How do I stop the kettle from whistling in the morning?", phrases))
|
||||
assertFalse(isStopPhrase("", phrases))
|
||||
assertTrue(isStopPhrase("Ďakujem, to je všetko", listOf("ďakujem to je všetko")))
|
||||
}
|
||||
}
|
||||
@@ -392,6 +392,16 @@ object Fakes {
|
||||
speaking = true,
|
||||
)
|
||||
|
||||
/** A spoken conversation: the answer read, listening again. */
|
||||
val assistConversation = assistBase.copy(
|
||||
chatId = "c9",
|
||||
turns = listOf(AssistTurn(question.text.orEmpty(), earlier = answer.steps)),
|
||||
conversation = true,
|
||||
listening = true,
|
||||
heard = "And how long for the honey cakes",
|
||||
level = 0.3f,
|
||||
)
|
||||
|
||||
/** An answer being written. */
|
||||
val assistWriting = assistBase.copy(
|
||||
chatId = "c9",
|
||||
|
||||
@@ -260,6 +260,8 @@ class ScreenShots {
|
||||
shoot("21-assistant-writing", content = over(Fakes.assistWriting, false))
|
||||
shoot("22-assistant-locked", content = over(Fakes.assistOpened, true))
|
||||
shoot("23-assistant-offline", Phone.Small, content = over(Fakes.assistOffline, false))
|
||||
shoot("24-assistant-conversation", content = over(Fakes.assistConversation, false))
|
||||
shoot("24-assistant-conversation", Phone.Small, fontScale = 1.5f, content = over(Fakes.assistConversation, false))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user