Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4344b35a27
|
||
|
|
6540d160df
|
||
|
|
a4a5c5dba1
|
||
|
|
cdb6a35371
|
||
|
|
5e45293462
|
||
|
|
7ca44ef5e2
|
||
|
|
2f43b94e56
|
No files matched your search
@@ -3,6 +3,81 @@
|
||||
What changed in each release of LLeMbas for Android. Versions follow SemVer; until 1.0.0 the app
|
||||
is in alpha and releases come off `main`.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.0.0-beta.10] — 2026-11-13
|
||||
|
||||
### Added
|
||||
|
||||
- **Assistant model** in Settings › Assistant: the model the assistant's new chats start on --
|
||||
*Instance default* (your account's default, as before) or any model of the instance. A large
|
||||
default model is slow to answer a spoken question; a quick one can be chosen for the assistant
|
||||
alone. It holds for every way in: the sheet, the wake word, Share. Picking a model in the
|
||||
sheet still changes it too.
|
||||
|
||||
### Changed
|
||||
|
||||
- **The wake word and the hands-free parts of the voice assistant are marked Experimental** in
|
||||
Settings: the wake word as a whole, and with the assistant *Start listening when the
|
||||
assistant opens* and *Keep a spoken conversation going*. They are new and have been tried on
|
||||
few phones: the wake word may miss the phrase, start by mistake, or hear you and still not
|
||||
open the assistant; listening may stop too early or too late. Typing a question and the
|
||||
microphone button are the parts to rely on.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The wake word with the screen off: the sheet showed for a moment and was gone.** A phone
|
||||
whose screen is off is locked, and a sheet opened over the lock screen asked Android to unlock
|
||||
first and closed itself when that was turned down -- which is what happens when nobody is
|
||||
there to unlock. Opened to listen (the wake word, a headset's button), the sheet now stays up
|
||||
over the lock screen and listens, and Android is asked to unlock once it has heard you: a face
|
||||
or a fingerprint sends the question. Leave it, and it stays until the screen goes off.
|
||||
- **Nothing goes to your instance while the phone is locked.** Not the question, not the
|
||||
recording, not even "which models are there". With Voice input › LLeMbas the question waits on
|
||||
the phone as a recording -- the sheet says *Question heard*, with no words, and **Unlock to
|
||||
send** -- and is written down and asked once you unlock. With Voice input › Phone the phone's
|
||||
own recogniser writes it down (the recording goes wherever that recogniser sends it, as
|
||||
always) and the words are shown while they wait. No answer is shown or spoken over the lock
|
||||
screen, and an answer over the lock screen is not offered.
|
||||
- **A phone that locks while the assistant is open stops there.** The screen going off stops the
|
||||
microphone and the voice at once; a question still being listened to is dropped; an answer is
|
||||
no longer read aloud on a locked phone, a spoken conversation does not go on, and the
|
||||
conversation that was on the sheet is not readable over the lock screen -- nor a failure's
|
||||
words, which may name the instance. The screen stays on while an answer is read aloud.
|
||||
- **Another app can no longer put a question into the assistant.** The
|
||||
sheet's screen has to be startable by Android (the assist action, a headset's button), so any
|
||||
app can start it. A question handed from the assistant's own sheet no longer travels in the
|
||||
intent, where any app could have written one to be asked on your account (or to wait for your
|
||||
next unlock): it stays in the app's memory and the intent carries a one-time ticket. Opening
|
||||
listening, the last chat and turning the screen on are honoured only on intents the app made
|
||||
itself. Android's own headset actions still open it listening, as they must.
|
||||
- The sheet no longer asks its question a second time, or loses the one that waits, when the
|
||||
phone is turned, folded or switches theme while it is up.
|
||||
- Closing the sheet lets go of the microphone at once, also when it was closed in the middle of
|
||||
listening.
|
||||
- Listening no longer runs to the limit after speech into a headset that gates its noise to
|
||||
exact silence, and no longer gives up as "nothing said" on someone who goes straight on after
|
||||
the wake word in a steady voice. The phone's recogniser is not given up on while it reports
|
||||
speech but shows no words yet.
|
||||
- **A new assistant chat could start on the wrong model.** After *Continue the last chat*, *New
|
||||
chat* kept that chat's model instead of going back to the assistant's own; and a question
|
||||
sent the moment the sheet opened, before the instance had said which models it has, went to
|
||||
the instance's default whatever was chosen.
|
||||
|
||||
- **Listening went on and on in a quiet room.** With the instance's speech-to-text the sheet
|
||||
decided "somebody is speaking" and "it is quiet again" by two fixed loudness levels. A phone
|
||||
whose room noise sat above the quiet level never heard a pause, so it listened until the
|
||||
two-minute limit; and words the speech-to-text invented from silence counted as speech. Now
|
||||
the room's own level is measured from the first moment and followed all the time, and speech
|
||||
and quiet are judged against it: nothing said ends after five seconds, a question ends a
|
||||
second and a half after you stop, a click or a knock is not speech, and the limit is one
|
||||
minute. Silence is no longer sent to be written down while you have said nothing.
|
||||
- The phone's own recogniser (Voice input › Phone) is asked for the same pause, and is watched:
|
||||
one that never answers no longer leaves the sheet listening for good.
|
||||
- An app that uses the system's recogniser while LLeMbas is the assistant no longer waits the
|
||||
full fifteen seconds every time: it ends at the pause after speech, or says that nothing was
|
||||
said.
|
||||
|
||||
## [1.0.0-beta.9] — 2026-11-13
|
||||
|
||||
For LLeMbas server 2.0.0-beta.12 or later.
|
||||
|
||||
@@ -46,6 +46,13 @@ hotword detection for the system's own preinstalled assistant, so LLeMbas listen
|
||||
on-device engine in a microphone service, with a notification up the whole time; nothing leaves
|
||||
the phone before the word. Not in the F-Droid build.
|
||||
|
||||
The wake word and the hands-free parts of the voice assistant (listening by itself, the spoken
|
||||
conversation) are **experimental**: new, and tried on few phones. Settings marks them so.
|
||||
|
||||
Over the lock screen the assistant can listen (the wake word, a headset's button), but nothing
|
||||
goes to the instance and no answer is shown or spoken until the phone is unlocked: with the
|
||||
instance's speech-to-text the question waits on the phone as a recording.
|
||||
|
||||
## Build
|
||||
|
||||
Builds run on GitHub Actions (`.github/workflows/ci.yml`); locally it is
|
||||
|
||||
@@ -31,7 +31,7 @@ android {
|
||||
// The one source of the version. versionCode is derived from it, so the two cannot
|
||||
// drift, and a beta sorts below its release: 1.0.0-beta.1 -> 1000001,
|
||||
// 1.0.0-beta.2 -> 1000002, 1.0.0 -> 1000099, 1.2.3 -> 1020399.
|
||||
versionName = "1.0.0-beta.9"
|
||||
versionName = "1.0.0-beta.10"
|
||||
versionCode = versionName!!.split("-beta.").let { parts ->
|
||||
val (a, b, c) = parts[0].split(".").map { it.toInt() }
|
||||
val pre = if (parts.size == 2) parts[1].toInt() else 99
|
||||
|
||||
@@ -63,10 +63,14 @@
|
||||
|
||||
<!-- The assistant's sheet as an activity: the tile, the widget, the shortcuts,
|
||||
ACTION_ASSIST, a headset's voice button, and the lock-screen path (it asks to
|
||||
unlock before sending anything). -->
|
||||
unlock before sending anything). Exported for Android's own actions; what only the
|
||||
app's own parts may ask of it is told apart in OwnIntents.kt. It handles
|
||||
configuration changes itself (Compose redraws): turned, folded or switched to the
|
||||
dark theme, it is not made again, and neither is the question it holds. -->
|
||||
<activity
|
||||
android:name=".assist.AssistActivity"
|
||||
android:exported="true"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|navigation|uiMode|density|fontScale"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity=""
|
||||
|
||||
@@ -53,6 +53,7 @@ class LembasApp : Application() {
|
||||
manager.deleteNotificationChannel("reports")
|
||||
// The launcher's long-press shortcuts, in the app's language as it is now.
|
||||
eu.llembas.android.widget.Shortcuts.publish(this)
|
||||
eu.llembas.android.widget.AskWidget.refresh(this)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -3,10 +3,13 @@ package eu.llembas.android.assist
|
||||
import android.Manifest
|
||||
import android.app.KeyguardManager
|
||||
import android.app.NotificationManager
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
||||
import android.view.WindowManager
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
@@ -14,6 +17,7 @@ import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import eu.llembas.android.AppLanguage
|
||||
import eu.llembas.android.auth.Prefs
|
||||
@@ -22,6 +26,9 @@ import eu.llembas.android.ui.theme.LembasTheme
|
||||
import eu.llembas.android.wake.AssistLink
|
||||
import eu.llembas.android.wake.AssistPresence
|
||||
import eu.llembas.android.wake.WakeWordService
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.launch
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
/** What a way into the sheet asks for. */
|
||||
@@ -34,30 +41,64 @@ enum class Opening {
|
||||
companion object {
|
||||
/**
|
||||
* A headset's voice button sends `VOICE_COMMAND` (or, locked, `VOICE_SEARCH_HANDS_FREE`):
|
||||
* the person means to speak, so the sheet opens listening whatever Settings says.
|
||||
* the person means to speak, so the sheet opens listening whatever Settings says. Those
|
||||
* two are Android's, and anybody's to send. The app's own ways in -- listening for the
|
||||
* widget's microphone and the wake word, the last chat -- count only on an intent the
|
||||
* app made itself ([own], [OwnIntents]); from anyone else they are just the sheet.
|
||||
*/
|
||||
fun of(intent: Intent): Opening = when {
|
||||
intent.getBooleanExtra(AssistActivity.EXTRA_LISTEN, false) -> Listen
|
||||
intent.action == AssistActivity.ACTION_CONTINUE -> Continue
|
||||
intent.action in LISTENING -> Listen
|
||||
fun of(action: String?, listenExtra: Boolean, own: Boolean): Opening = when {
|
||||
own && listenExtra -> Listen
|
||||
own && action == AssistActivity.ACTION_CONTINUE -> Continue
|
||||
own && action == AssistActivity.ACTION_LISTEN -> Listen
|
||||
action in PUBLIC_LISTENING -> Listen
|
||||
else -> Sheet
|
||||
}
|
||||
|
||||
private val LISTENING = setOf(
|
||||
AssistActivity.ACTION_LISTEN,
|
||||
Intent.ACTION_VOICE_COMMAND,
|
||||
"android.speech.action.VOICE_SEARCH_HANDS_FREE",
|
||||
)
|
||||
fun of(intent: Intent, own: Boolean): Opening = of(intent.action, own && intent.getBooleanExtra(AssistActivity.EXTRA_LISTEN, false), own)
|
||||
|
||||
private val PUBLIC_LISTENING = setOf(Intent.ACTION_VOICE_COMMAND, "android.speech.action.VOICE_SEARCH_HANDS_FREE")
|
||||
}
|
||||
}
|
||||
|
||||
/** How the sheet starts, given whether the phone is locked. */
|
||||
enum class LockedStart {
|
||||
/** Not locked: do what the way in asked for. */
|
||||
Go,
|
||||
|
||||
/** Locked, and the way in means to speak: stay over the lock screen and listen; what is heard waits for the unlock. */
|
||||
Listen,
|
||||
|
||||
/** Locked, with a question handed over: it is shown and waits for the unlock. */
|
||||
Hold,
|
||||
|
||||
/** Locked, anything else: ask Android to unlock first; the sheet goes if that is turned down. */
|
||||
Unlock,
|
||||
}
|
||||
|
||||
/**
|
||||
* What a sheet opened while the phone is [locked] does. The wake word with the screen off, and a
|
||||
* headset's button, open it listening ([Opening.Listen]) and nobody is there to unlock: asking
|
||||
* Android to unlock first -- and closing when that is cancelled, which is what happens when
|
||||
* nobody answers the lock screen -- showed the sheet for a moment and took it away again. So it
|
||||
* stays and listens, and only *sending* waits for the unlock. Without the microphone's
|
||||
* permission there is nothing to listen with, and its prompt needs the phone unlocked anyway.
|
||||
*/
|
||||
fun lockedStart(locked: Boolean, opening: Opening, question: Boolean, micAllowed: Boolean): LockedStart = when {
|
||||
!locked -> LockedStart.Go
|
||||
question -> LockedStart.Hold
|
||||
opening == Opening.Listen && micAllowed -> LockedStart.Listen
|
||||
else -> LockedStart.Unlock
|
||||
}
|
||||
|
||||
/**
|
||||
* The assistant as an activity: what the Quick Settings tile, the "Ask" shortcut and a plain
|
||||
* `ACTION_ASSIST` open, and where the voice-interaction session hands over what needs an
|
||||
* activity -- a question asked over the lock screen, or the microphone's permission prompt
|
||||
* ([EXTRA_LISTEN]). The same sheet as the session's, in a see-through window over the app
|
||||
* underneath. Shown over the lock screen, but it asks Android to unlock before it sends
|
||||
* anything -- and shows nothing from the account until then.
|
||||
* anything -- and shows nothing from the account until then. Opened there to listen (the wake
|
||||
* word, a headset's button) it stays up and listens; the question it heard is shown and waits
|
||||
* for the unlock ([lockedStart]).
|
||||
*/
|
||||
class AssistActivity : ComponentActivity() {
|
||||
private lateinit var controller: AssistController
|
||||
@@ -65,12 +106,38 @@ class AssistActivity : ComponentActivity() {
|
||||
private var started = false
|
||||
private var byWake = false
|
||||
|
||||
/** The screen went off since the sheet was last seen: on the way back, the lock is looked at again. */
|
||||
private var wentOff = false
|
||||
|
||||
/** Whether the phone is locked: the sheet shows nothing from the account until it is not. */
|
||||
private val locked = mutableStateOf(false)
|
||||
private val mic = registerForActivityResult(ActivityResultContracts.RequestPermission()) { granted ->
|
||||
if (granted) controller.listen()
|
||||
}
|
||||
|
||||
/**
|
||||
* The phone was unlocked by the person themselves (a fingerprint while the sheet is up): the
|
||||
* question that waited is sent. And the screen went off: the microphone and the voice stop
|
||||
* at once, whatever the lock says yet, and nothing of the conversation is left in the
|
||||
* picture the phone keeps of the sheet; a sheet that was over the lock screen goes, so that
|
||||
* it is not what the phone shows when it is next picked up.
|
||||
*/
|
||||
private val screen = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
when (intent.action) {
|
||||
Intent.ACTION_USER_PRESENT -> unlockedNow()
|
||||
|
||||
Intent.ACTION_SCREEN_OFF -> {
|
||||
val overLock = locked.value
|
||||
wentOff = true
|
||||
if (keyguard.isKeyguardLocked) controller.lockedNow() else controller.screenOff()
|
||||
locked.value = true
|
||||
if (overLock) finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun attachBaseContext(newBase: Context) = super.attachBaseContext(AppLanguage.wrap(newBase))
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@@ -80,10 +147,39 @@ class AssistActivity : ComponentActivity() {
|
||||
controller = AssistController(this, lifecycleScope)
|
||||
keyguard = getSystemService(KeyguardManager::class.java)
|
||||
locked.value = keyguard.isKeyguardLocked
|
||||
ContextCompat.registerReceiver(
|
||||
this,
|
||||
screen,
|
||||
IntentFilter().apply {
|
||||
addAction(Intent.ACTION_USER_PRESENT)
|
||||
addAction(Intent.ACTION_SCREEN_OFF)
|
||||
},
|
||||
ContextCompat.RECEIVER_NOT_EXPORTED,
|
||||
)
|
||||
// A question waits for the unlock: Android is asked for it at once (a face or a
|
||||
// fingerprint is then enough), and the sheet stays if nobody answers.
|
||||
lifecycleScope.launch {
|
||||
controller.state.map { it.held }.distinctUntilChanged().collect { held ->
|
||||
if (held && locked.value) askToUnlock()
|
||||
}
|
||||
}
|
||||
// The lock screen turns the display off after a few seconds: not in the middle of a
|
||||
// question, and not in the middle of an answer read aloud (the screen going off stops it).
|
||||
lifecycleScope.launch {
|
||||
controller.state.map { it.listening || it.busy || it.speaking }.distinctUntilChanged().collect { on ->
|
||||
if (on) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) else window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
}
|
||||
}
|
||||
// Opened by the wake word: the screen comes on with it (a spoken phrase is not a touch,
|
||||
// so nothing else has woken the phone).
|
||||
woken(intent)
|
||||
take(intent)
|
||||
// Once: made again by Android (after the app was put away and brought back), the sheet
|
||||
// must not ask the same question a second time. What waited for the unlock is kept.
|
||||
if (savedInstanceState == null) {
|
||||
take(intent)
|
||||
} else {
|
||||
savedInstanceState.getString(STATE_WAITING)?.let { controller.hold(Held(it, null, savedInstanceState.getBoolean(STATE_SPOKEN))) }
|
||||
}
|
||||
setContent {
|
||||
val prefs by lembas.instances.prefs.collectAsState(initial = Prefs())
|
||||
LembasTheme(prefs.theme) {
|
||||
@@ -91,15 +187,13 @@ class AssistActivity : ComponentActivity() {
|
||||
controller = controller,
|
||||
locked = locked.value,
|
||||
onUnlockAndAsk = { text ->
|
||||
keyguard.requestDismissKeyguard(
|
||||
this@AssistActivity,
|
||||
object : KeyguardManager.KeyguardDismissCallback() {
|
||||
override fun onDismissSucceeded() {
|
||||
locked.value = false
|
||||
if (text.isBlank()) controller.opened(locked = false) else controller.ask(text)
|
||||
}
|
||||
},
|
||||
)
|
||||
// Typed over the lock screen: held (in the place of a question that
|
||||
// waited already), so that whichever way the unlock is heard of first,
|
||||
// one question is asked, once.
|
||||
val waited = controller.state.value.held
|
||||
if (text.isNotBlank()) controller.ask(text)
|
||||
// A first held question asks Android to unlock by itself (onCreate).
|
||||
if (waited || text.isBlank()) askToUnlock { if (text.isBlank()) controller.opened() }
|
||||
},
|
||||
onOpenApp = {
|
||||
startActivity(controller.appIntent())
|
||||
@@ -107,6 +201,7 @@ class AssistActivity : ComponentActivity() {
|
||||
},
|
||||
onNeedMic = { mic.launch(Manifest.permission.RECORD_AUDIO) },
|
||||
onDismiss = { finish() },
|
||||
onUnlock = { askToUnlock() },
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -128,7 +223,7 @@ class AssistActivity : ComponentActivity() {
|
||||
* the assistant's own sheet can take its place if that one comes after all.
|
||||
*/
|
||||
private fun woken(intent: Intent?) {
|
||||
byWake = intent?.getBooleanExtra(EXTRA_WAKE, false) == true
|
||||
byWake = OwnIntents.isOwn(this, intent) && intent?.getBooleanExtra(EXTRA_WAKE, false) == true
|
||||
if (byWake) setTurnScreenOn(true)
|
||||
}
|
||||
|
||||
@@ -140,6 +235,16 @@ class AssistActivity : ComponentActivity() {
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
started = true
|
||||
// The phone may have locked, or been unlocked, while the sheet was out of sight.
|
||||
if (keyguard.isKeyguardLocked) {
|
||||
// Found locked: the controller is told, unless the sheet was opened over the lock
|
||||
// screen in the first place (and is listening there).
|
||||
if (!locked.value || wentOff) controller.lockedNow()
|
||||
locked.value = true
|
||||
} else {
|
||||
unlockedNow()
|
||||
}
|
||||
wentOff = false
|
||||
open = WeakReference(this)
|
||||
AssistPresence.shown()
|
||||
AssistLink.sheetShown(SystemClock.elapsedRealtime())
|
||||
@@ -155,29 +260,41 @@ class AssistActivity : ComponentActivity() {
|
||||
}
|
||||
|
||||
/**
|
||||
* What the way in asked for: a question handed over by the session, listening (the headset's
|
||||
* voice button, the widget's microphone, the Speak shortcut), the last assistant chat (the
|
||||
* widget, the shortcut), or just the sheet. Over the lock screen each waits for Android to
|
||||
* unlock first.
|
||||
* What the way in asked for: a question handed over by the session ([AssistHandOff]),
|
||||
* listening (the headset's voice button, the widget's microphone, the Speak shortcut, the
|
||||
* wake word), the last assistant chat (the widget, the shortcut), or just the sheet. Over
|
||||
* the lock screen: [lockedStart]. Only an intent the app made itself ([OwnIntents]) can
|
||||
* hand over a question or ask for more than Android's own actions do.
|
||||
*/
|
||||
private fun take(intent: Intent) {
|
||||
val opening = Opening.of(intent)
|
||||
val waiting = intent.getStringExtra(EXTRA_QUESTION).orEmpty()
|
||||
val own = OwnIntents.isOwn(this, intent)
|
||||
val opening = Opening.of(intent, own)
|
||||
val handed = if (own) AssistHandOff.take(intent.getStringExtra(EXTRA_HANDOFF)) else null
|
||||
val go = {
|
||||
when {
|
||||
waiting.isNotBlank() -> controller.ask(waiting)
|
||||
handed != null -> controller.hold(handed)
|
||||
opening == Opening.Continue -> controller.continueWhenReady()
|
||||
opening == Opening.Listen && !controller.micAllowed() -> mic.launch(Manifest.permission.RECORD_AUDIO)
|
||||
opening == Opening.Listen -> controller.opened(locked = false, listen = true)
|
||||
else -> controller.opened(locked = false)
|
||||
opening == Opening.Listen -> controller.opened(listen = true)
|
||||
else -> controller.opened()
|
||||
}
|
||||
}
|
||||
if (keyguard.isKeyguardLocked) {
|
||||
keyguard.requestDismissKeyguard(
|
||||
val isLocked = keyguard.isKeyguardLocked
|
||||
if (isLocked) locked.value = true
|
||||
when (lockedStart(isLocked, opening, handed != null, controller.micAllowed())) {
|
||||
// Not locked, a handed-over question is asked at once ([AssistController.hold]).
|
||||
LockedStart.Go -> go()
|
||||
|
||||
LockedStart.Listen -> controller.opened(listen = true)
|
||||
|
||||
// Shown, and Android asked to unlock (the collector in onCreate): it stays if nobody does.
|
||||
LockedStart.Hold -> handed?.let { controller.hold(it) }
|
||||
|
||||
LockedStart.Unlock -> keyguard.requestDismissKeyguard(
|
||||
this,
|
||||
object : KeyguardManager.KeyguardDismissCallback() {
|
||||
override fun onDismissSucceeded() {
|
||||
locked.value = false
|
||||
unlockedNow()
|
||||
go()
|
||||
}
|
||||
|
||||
@@ -186,18 +303,58 @@ class AssistActivity : ComponentActivity() {
|
||||
override fun onDismissError() = finish()
|
||||
},
|
||||
)
|
||||
} else {
|
||||
go()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask Android to unlock. When it does, the question that waited is sent and [then] runs.
|
||||
* When it does not -- nobody there, or Back on the lock screen -- nothing happens: the sheet
|
||||
* stays as it is, with the way to try again.
|
||||
*/
|
||||
private fun askToUnlock(then: () -> Unit = {}) {
|
||||
keyguard.requestDismissKeyguard(
|
||||
this,
|
||||
object : KeyguardManager.KeyguardDismissCallback() {
|
||||
override fun onDismissSucceeded() {
|
||||
unlockedNow()
|
||||
then()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* The phone is unlocked now, however that was heard of -- Android's answer to the asking,
|
||||
* the person's own unlock, the sheet coming back: once, and only if the lock itself says so.
|
||||
*/
|
||||
private fun unlockedNow() {
|
||||
if (!locked.value || keyguard.isKeyguardLocked) return
|
||||
locked.value = false
|
||||
controller.unlocked()
|
||||
}
|
||||
|
||||
/** A question that waits for the unlock outlives the sheet being made again; a recording does not. */
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
val waiting = controller.state.value.waiting
|
||||
if (waiting.isNotBlank()) {
|
||||
outState.putString(STATE_WAITING, waiting)
|
||||
outState.putBoolean(STATE_SPOKEN, controller.heldSpoken)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
runCatching { unregisterReceiver(screen) }
|
||||
controller.close()
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val EXTRA_QUESTION = "eu.llembas.android.QUESTION"
|
||||
/** The ticket of a question handed over by the session ([AssistHandOff]); never the question. */
|
||||
const val EXTRA_HANDOFF = "eu.llembas.android.HANDOFF"
|
||||
|
||||
private const val STATE_WAITING = "waiting"
|
||||
private const val STATE_SPOKEN = "spoken"
|
||||
|
||||
/** Handed over by the session: ask for the microphone, then listen. */
|
||||
const val EXTRA_LISTEN = "eu.llembas.android.LISTEN"
|
||||
@@ -209,7 +366,7 @@ class AssistActivity : ComponentActivity() {
|
||||
const val ACTION_CONTINUE = "eu.llembas.android.action.CONTINUE"
|
||||
|
||||
/** The sheet, listening. */
|
||||
fun listening(context: Context): Intent = Intent(context, AssistActivity::class.java).setAction(ACTION_LISTEN)
|
||||
fun listening(context: Context): Intent = OwnIntents.own(context, Intent(context, AssistActivity::class.java).setAction(ACTION_LISTEN))
|
||||
|
||||
/** The sheet that is on screen now, if this activity is it. */
|
||||
@Volatile
|
||||
@@ -227,6 +384,12 @@ class AssistActivity : ComponentActivity() {
|
||||
fun woken(context: Context): Intent = listening(context).putExtra(EXTRA_WAKE, true).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
|
||||
/** The sheet, at the last assistant chat. */
|
||||
fun continuing(context: Context): Intent = Intent(context, AssistActivity::class.java).setAction(ACTION_CONTINUE)
|
||||
fun continuing(context: Context): Intent = OwnIntents.own(context, Intent(context, AssistActivity::class.java).setAction(ACTION_CONTINUE))
|
||||
|
||||
/** The sheet, taking the question left under [ticket] -- or asking for the microphone and listening. */
|
||||
fun handedOver(context: Context, ticket: String?, listen: Boolean): Intent = OwnIntents.own(
|
||||
context,
|
||||
Intent(context, AssistActivity::class.java).putExtra(EXTRA_HANDOFF, ticket).putExtra(EXTRA_LISTEN, listen).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package eu.llembas.android.assist
|
||||
|
||||
import android.Manifest
|
||||
import android.app.KeyguardManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.Bitmap
|
||||
import android.os.SystemClock
|
||||
import android.speech.SpeechRecognizer
|
||||
import androidx.core.content.ContextCompat
|
||||
import eu.llembas.android.MainActivity
|
||||
@@ -22,13 +24,17 @@ import eu.llembas.android.notify.NotificationAccess
|
||||
import eu.llembas.android.notify.NotificationReader
|
||||
import eu.llembas.android.push.Notifications
|
||||
import eu.llembas.android.ui.explain
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.transformWhile
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.isActive
|
||||
@@ -45,6 +51,12 @@ data class AssistTurn(val question: String, val reply: LiveReply? = null, val ea
|
||||
val writing: Boolean get() = reply != null && reply.finished == null && !reply.closed
|
||||
}
|
||||
|
||||
/**
|
||||
* A question that waits for the phone to be unlocked: its [text], or -- heard where the instance
|
||||
* writes speech down -- its recording ([wav]), which stays on the phone until then.
|
||||
*/
|
||||
class Held(val text: String, val wav: ByteArray?, val spoken: Boolean)
|
||||
|
||||
/** Whether the instance answers: being asked, yes, or no (and why). */
|
||||
enum class Connection { Checking, Online, Offline }
|
||||
|
||||
@@ -85,7 +97,21 @@ data class AssistUiState(
|
||||
val conversation: Boolean = false,
|
||||
/** Whether the person let the assistant read the notifications when asked (Settings and Android both). */
|
||||
val canReadNotifications: Boolean = false,
|
||||
/**
|
||||
* A question that waits for the phone to be unlocked: typed over the lock screen, or heard
|
||||
* there by the phone's own recogniser -- the person's own words and nothing from the
|
||||
* account. Asked once the phone is unlocked.
|
||||
*/
|
||||
val waiting: String = "",
|
||||
/**
|
||||
* A question heard over the lock screen that waits as a recording, on the phone: the
|
||||
* instance writes speech down, and nothing goes to the instance while the phone is locked.
|
||||
*/
|
||||
val waitingRecording: Boolean = false,
|
||||
) {
|
||||
/** Whether a question waits for the unlock, as words or as a recording. */
|
||||
val held: Boolean get() = waiting.isNotBlank() || waitingRecording
|
||||
|
||||
val screenAvailable: Boolean get() = screenText || screenshot != null
|
||||
val modelInfo: ModelInfo? get() = models.firstOrNull { it.id == modelId }
|
||||
val empty: Boolean get() = turns.isEmpty()
|
||||
@@ -127,7 +153,15 @@ interface AssistActions {
|
||||
* a moment behind, from the recording so far, and a pause in speech sends it), or the phone's
|
||||
* own recogniser (the words as they are said). Speech out is the instance's text-to-speech.
|
||||
*/
|
||||
class AssistController(private val context: Context, private val scope: CoroutineScope) : AssistActions {
|
||||
class AssistController(
|
||||
private val context: Context,
|
||||
private val scope: CoroutineScope,
|
||||
/**
|
||||
* Whether the phone is locked, asked each time it matters. While it is, nothing goes to the
|
||||
* instance from here: no question, no recording to write down, not even "which models".
|
||||
*/
|
||||
private val locked: () -> Boolean = { context.getSystemService(KeyguardManager::class.java)?.isKeyguardLocked == true },
|
||||
) : AssistActions {
|
||||
private val _state = MutableStateFlow(AssistUiState())
|
||||
val state = _state.asStateFlow()
|
||||
private val recorder = Recorder(scope)
|
||||
@@ -136,18 +170,65 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
private val route = HeadsetRoute(context)
|
||||
private var following: Job? = null
|
||||
private var hearing: Job? = null
|
||||
|
||||
/** The ear for the end of speech, while the instance's speech-to-text listens. */
|
||||
private var ear: EndOfSpeech? = null
|
||||
private var usingPhone = false
|
||||
private var screenText: String? = null
|
||||
private var stt: Boolean? = null
|
||||
private val ready: Job
|
||||
|
||||
/** The account's own default model, as the instance said it: what "Instance default" means. */
|
||||
private var accountDefault: String? = null
|
||||
|
||||
/**
|
||||
* The model a new chat starts on (Settings › Assistant › Assistant model). The sheet's
|
||||
* [AssistUiState.modelId] is the model of the chat it is in, which for a continued chat is
|
||||
* that chat's own; a new chat goes back to this one.
|
||||
*/
|
||||
private var newChatModel: String? = null
|
||||
|
||||
/** The question that waits for the unlock ([hold]). */
|
||||
private var held: Held? = null
|
||||
|
||||
/** Whether the question that waits was spoken. */
|
||||
val heldSpoken: Boolean get() = held?.spoken == true
|
||||
|
||||
/** When the phone's recogniser last gave a sign of somebody speaking (elapsed ms). */
|
||||
private var phoneActiveAt = 0L
|
||||
|
||||
/** What the phone itself knows: Settings, the instance's name. */
|
||||
private val local: Job
|
||||
|
||||
/** What the instance says -- its models, what it offers: asked only once the phone is unlocked. */
|
||||
private var remote: Job? = null
|
||||
|
||||
init {
|
||||
ready = scope.launch { load() }
|
||||
local = scope.launch {
|
||||
loadLocal()
|
||||
if (!locked()) askInstance()
|
||||
}
|
||||
scope.launch { speaker.playing.collect { on -> _state.update { it.copy(speaking = on) } } }
|
||||
// Settings changed the assistant's model while this sheet lives: the next new chat has it.
|
||||
scope.launch {
|
||||
context.lembas.instances.prefs.map { it.assistantModel }.distinctUntilChanged().drop(1).collect { chosen ->
|
||||
ready()
|
||||
newChatModel = assistantModelFor(chosen, accountDefault, _state.value.models) ?: chosen.ifBlank { null }
|
||||
_state.update { if (it.chatId == null) it.copy(modelId = newChatModel) else it }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** The instance, its models and what it offers this account; the choices kept in Settings. */
|
||||
private suspend fun load() {
|
||||
/** Everything known: Settings, and -- unless the phone is locked -- what the instance says. */
|
||||
private suspend fun ready() {
|
||||
local.join()
|
||||
if (!locked()) askInstance().join()
|
||||
}
|
||||
|
||||
/** Ask the instance what it has, once. */
|
||||
private fun askInstance(): Job = remote ?: scope.launch { loadRemote() }.also { remote = it }
|
||||
|
||||
/** The choices kept in Settings, and which instance: nothing here leaves the phone. */
|
||||
private suspend fun loadLocal() {
|
||||
val store = context.lembas.instances
|
||||
val instance = store.current()
|
||||
val prefs = store.prefs.first()
|
||||
@@ -161,15 +242,23 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
?.let { id -> LastAssist(id, prefs.lastAssistTitle, prefs.lastAssistAt) },
|
||||
)
|
||||
}
|
||||
val api = instance?.let { store.clientFor(it) } ?: return
|
||||
// Until the instance has said what it has, the choice in Settings stands as it is: a
|
||||
// question asked while the list could not be read still goes to the chosen model.
|
||||
newChatModel = prefs.assistantModel.ifBlank { null }
|
||||
}
|
||||
|
||||
/** The instance's models and what it offers this account. */
|
||||
private suspend fun loadRemote() {
|
||||
val store = context.lembas.instances
|
||||
val prefs = store.prefs.first()
|
||||
val api = store.current()?.let { store.clientFor(it) } ?: return
|
||||
try {
|
||||
val me = api.me()
|
||||
val models = api.models()
|
||||
stt = me.speechToText
|
||||
val chosen = prefs.assistantModel.takeIf { id -> models.any { it.id == id } }
|
||||
?: me.defaultModel?.takeIf { id -> models.any { it.id == id } }
|
||||
?: models.firstOrNull { it.default }?.id
|
||||
?: models.firstOrNull()?.id
|
||||
accountDefault = me.defaultModel
|
||||
val chosen = assistantModelFor(prefs.assistantModel, me.defaultModel, models)
|
||||
newChatModel = chosen
|
||||
_state.update {
|
||||
it.copy(
|
||||
connection = Connection.Online,
|
||||
@@ -186,26 +275,101 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
|
||||
/**
|
||||
* The sheet came up. It starts listening at once -- the microphone first, as an assistant
|
||||
* opens -- unless Settings says not to, the phone is locked (nothing is sent from the lock
|
||||
* screen), or the microphone is not allowed yet (that needs an activity to ask). [listen]
|
||||
* is a way in that means to speak -- a headset's voice button -- and listens regardless.
|
||||
* opens -- unless Settings says not to or the microphone is not allowed yet (that needs an
|
||||
* activity to ask). [listen] is a way in that means to speak -- the wake word, a headset's
|
||||
* voice button -- and listens regardless.
|
||||
*
|
||||
* Over the lock screen only such a way in listens, and what it hears is held for the unlock
|
||||
* ([hold]), never asked from there; the microphone opens without waiting for the instance.
|
||||
*/
|
||||
fun opened(locked: Boolean, listen: Boolean = false) {
|
||||
fun opened(listen: Boolean = false) {
|
||||
scope.launch {
|
||||
ready.join()
|
||||
if (locked()) {
|
||||
local.join()
|
||||
val s = _state.value
|
||||
if (listen && s.signedIn && !s.listening && !s.held && micAllowed()) listen()
|
||||
return@launch
|
||||
}
|
||||
ready()
|
||||
val prefs = context.lembas.instances.prefs.first()
|
||||
val s = _state.value
|
||||
if (s.signedIn && !locked && (listen || prefs.assistantListens) && s.canListen && !s.listening && micAllowed()) {
|
||||
if (s.signedIn && (listen || prefs.assistantListens) && s.canListen && !s.listening && micAllowed()) {
|
||||
if (listen || s.empty) listen()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Keep [question] until the phone is unlocked ([unlocked]); it takes the place of one that
|
||||
* waited already. With the phone not locked there is nothing to wait for.
|
||||
*/
|
||||
fun hold(question: Held) {
|
||||
if (question.text.isBlank() && question.wav == null) return
|
||||
held = question
|
||||
_state.update { it.copy(waiting = question.text, waitingRecording = question.wav != null, conversation = false) }
|
||||
if (!locked()) unlocked()
|
||||
}
|
||||
|
||||
/** The question that waits, taken away from here: to be handed to another sheet. */
|
||||
fun takeHeld(): Held? {
|
||||
val waited = held
|
||||
held = null
|
||||
_state.update { it.copy(waiting = "", waitingRecording = false) }
|
||||
return waited
|
||||
}
|
||||
|
||||
/**
|
||||
* The phone is unlocked: the instance is asked what it has, and the question that waited is
|
||||
* asked now -- a recording is written down first. Does nothing while the phone is still locked.
|
||||
*/
|
||||
fun unlocked() {
|
||||
if (locked()) return
|
||||
askInstance()
|
||||
val waited = takeHeld() ?: return
|
||||
val wav = waited.wav
|
||||
if (wav == null) {
|
||||
ask(waited.text, spoken = waited.spoken)
|
||||
return
|
||||
}
|
||||
scope.launch {
|
||||
try {
|
||||
_state.update { it.copy(busy = true, error = null) }
|
||||
val text = context.lembas.instances.client()?.transcribe(wav).orEmpty()
|
||||
_state.update { it.copy(busy = false) }
|
||||
if (text.isNotBlank()) ask(text, spoken = true)
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
_state.update { it.copy(busy = false, error = context.explain(e)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The screen went off: the microphone and the voice stop, whatever the lock says -- nobody
|
||||
* is looking, and a phone that is about to lock must not go on listening or talking.
|
||||
*/
|
||||
fun screenOff() {
|
||||
speaker.stop()
|
||||
if (_state.value.listening) type()
|
||||
_state.update { it.copy(conversation = false) }
|
||||
}
|
||||
|
||||
/**
|
||||
* The phone locked while the sheet was up: as [screenOff], and the answer being written is
|
||||
* no longer followed. Whatever is asked from now on waits for the unlock ([ask]).
|
||||
*/
|
||||
fun lockedNow() {
|
||||
screenOff()
|
||||
following?.cancel()
|
||||
_state.update { it.copy(busy = false) }
|
||||
}
|
||||
|
||||
/** Open at the last assistant chat, once it is known which that is. */
|
||||
fun continueWhenReady() {
|
||||
scope.launch {
|
||||
ready.join()
|
||||
if (_state.value.last != null) continueLast() else opened(locked = false)
|
||||
ready()
|
||||
if (_state.value.last != null) continueLast() else opened()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,7 +402,11 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
val headset = route.microphone()
|
||||
if (usingPhone) {
|
||||
phone.start(
|
||||
onPartial = { words -> _state.update { it.copy(heard = words) } },
|
||||
onPartial = { words ->
|
||||
phoneActiveAt = SystemClock.elapsedRealtime()
|
||||
_state.update { it.copy(heard = words) }
|
||||
},
|
||||
onActive = { phoneActiveAt = SystemClock.elapsedRealtime() },
|
||||
onLevel = { l -> _state.update { it.copy(level = l) } },
|
||||
onResult = { words ->
|
||||
_state.update { it.copy(listening = false, level = 0f, heard = "") }
|
||||
@@ -256,8 +424,10 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
}
|
||||
},
|
||||
)
|
||||
watchPhone()
|
||||
} else {
|
||||
recorder.preferred = headset
|
||||
ear = EndOfSpeech(TICK_MS)
|
||||
recorder.start()
|
||||
launch { recorder.level.collect { l -> _state.update { it.copy(level = l) } } }
|
||||
launch { writeDownAsSaid() }
|
||||
@@ -271,7 +441,9 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
/**
|
||||
* The instance's speech-to-text takes a whole recording, so words "as they are said" are the
|
||||
* recording so far, written down again every moment -- one request at a time, only when half
|
||||
* a second more has been said, and not past the first minute.
|
||||
* a second more has been said, not past the first minute -- and not before the microphone
|
||||
* has heard anything above the room: silence written down is an invented sentence. Never
|
||||
* while the phone is locked: the recording stays on the phone until it is unlocked.
|
||||
*/
|
||||
private suspend fun writeDownAsSaid() {
|
||||
val api = context.lembas.instances.client() ?: return
|
||||
@@ -279,44 +451,75 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
while (scope.isActive) {
|
||||
delay(PARTIAL_EVERY_MS)
|
||||
val seconds = recorder.seconds
|
||||
if (seconds - sent < 0.5f || seconds > 60f) continue
|
||||
if (seconds - sent < 0.5f || seconds > 60f || ear?.heardSomething != true || locked()) continue
|
||||
sent = seconds
|
||||
val words = runCatching { api.transcribe(recorder.snapshot()) }.getOrNull()
|
||||
if (!words.isNullOrBlank() && _state.value.listening) _state.update { it.copy(heard = words) }
|
||||
}
|
||||
}
|
||||
|
||||
/** Wait for a pause after speech (true) -- or for nothing said at all, which gives up (false). */
|
||||
/**
|
||||
* Wait for a pause after speech (true) -- or for nothing said at all, which gives up (false).
|
||||
* [EndOfSpeech] decides, from the microphone's level against the room's own and the words
|
||||
* written down so far.
|
||||
*/
|
||||
private suspend fun untilQuiet(): Boolean {
|
||||
var spoke = false
|
||||
var quietFor = 0L
|
||||
var waited = 0L
|
||||
// The words written down so far are the second ear, for a quiet microphone: words the
|
||||
// instance heard mean speech, and the same words for a while mean it ended.
|
||||
var words = ""
|
||||
var sameWordsFor = 0L
|
||||
val ear = ear ?: return false
|
||||
while (true) {
|
||||
delay(TICK_MS)
|
||||
waited += TICK_MS
|
||||
val level = recorder.level.value
|
||||
if (level >= SPEAKING) {
|
||||
spoke = true
|
||||
quietFor = 0
|
||||
} else if (level < QUIET) {
|
||||
quietFor += TICK_MS
|
||||
// Over the lock screen no words are written down: the level alone decides.
|
||||
when (ear.tick(recorder.level.value, _state.value.heard)) {
|
||||
EndOfSpeech.Verdict.Said -> return true
|
||||
EndOfSpeech.Verdict.Nothing -> return false
|
||||
EndOfSpeech.Verdict.Listening -> Unit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The phone's recogniser finds the end of speech itself -- and is watched all the same
|
||||
* ([phoneWatch]): one that never calls back would leave the sheet listening for good.
|
||||
*/
|
||||
private suspend fun watchPhone() {
|
||||
var waited = 0L
|
||||
var words = ""
|
||||
var sameFor = 0L
|
||||
var asked = false
|
||||
val began = SystemClock.elapsedRealtime()
|
||||
phoneActiveAt = 0L
|
||||
while (_state.value.listening) {
|
||||
delay(TICK_MS)
|
||||
waited += TICK_MS
|
||||
val heard = _state.value.heard
|
||||
if (heard.isNotBlank()) spoke = true
|
||||
if (heard != words) {
|
||||
words = heard
|
||||
sameWordsFor = 0
|
||||
} else if (heard.isNotBlank()) {
|
||||
sameWordsFor += TICK_MS
|
||||
sameFor = 0
|
||||
} else {
|
||||
sameFor += TICK_MS
|
||||
}
|
||||
// Since it last gave a sign of somebody speaking; never, and it is as long as it has listened.
|
||||
val silentFor = if (phoneActiveAt >= began) SystemClock.elapsedRealtime() - phoneActiveAt else waited
|
||||
when (phoneWatch(waited, heard.isNotBlank(), sameFor, silentFor)) {
|
||||
PhoneWatch.Wait -> Unit
|
||||
|
||||
PhoneWatch.Finish -> if (!asked) {
|
||||
asked = true
|
||||
phone.finish()
|
||||
}
|
||||
|
||||
PhoneWatch.Take -> {
|
||||
phone.stop()
|
||||
_state.update { it.copy(listening = false, level = 0f, heard = "") }
|
||||
askOrStop(heard)
|
||||
return
|
||||
}
|
||||
|
||||
PhoneWatch.GiveUp -> {
|
||||
phone.stop()
|
||||
_state.update { it.copy(listening = false, level = 0f, heard = "", conversation = false) }
|
||||
return
|
||||
}
|
||||
}
|
||||
if (spoke && quietFor >= PAUSE_MS) return true
|
||||
if (sameWordsFor >= SAME_WORDS_MS) return true
|
||||
if (!spoke && waited >= NOTHING_SAID_MS) return false
|
||||
if (waited >= LONGEST_MS) return spoke
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,6 +539,13 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
_state.update { it.copy(heard = "") }
|
||||
return@launch
|
||||
}
|
||||
// Over the lock screen nothing goes to the instance, a recording to write down
|
||||
// included: it waits on the phone, and is written down and asked on the unlock.
|
||||
if (locked()) {
|
||||
_state.update { it.copy(heard = "") }
|
||||
hold(Held("", wav, spoken = true))
|
||||
return@launch
|
||||
}
|
||||
try {
|
||||
_state.update { it.copy(busy = true) }
|
||||
val text = context.lembas.instances.client()?.transcribe(wav).orEmpty()
|
||||
@@ -361,6 +571,7 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
|
||||
/** What was said: in a conversation, "stop" (or the like) ends it; anything else is asked. */
|
||||
private fun askOrStop(words: String) {
|
||||
if (locked()) return hold(Held(words, null, spoken = true))
|
||||
val phrases = context.getString(R.string.assist_stop_words).split("|")
|
||||
if (_state.value.conversation && isStopPhrase(words, phrases)) endConversation() else ask(words, spoken = true)
|
||||
}
|
||||
@@ -381,8 +592,13 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
/** The sheet's "Summarise my notifications": the notifications up now go with the question. */
|
||||
override fun summariseNotifications() = ask(context.getString(R.string.assist_notifications_prompt), spoken = false, notifications = true)
|
||||
|
||||
/**
|
||||
* Ask [question]. With the phone locked it is not asked but held for the unlock, whoever
|
||||
* called: this is the one door to the instance, and it is shut while the phone is locked.
|
||||
*/
|
||||
fun ask(question: String, spoken: Boolean, notifications: Boolean = false) {
|
||||
if (question.isBlank()) return
|
||||
if (locked()) return hold(Held(question, null, spoken))
|
||||
if (_state.value.listening) type()
|
||||
following?.cancel()
|
||||
following = scope.launch {
|
||||
@@ -396,6 +612,8 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
val store = context.lembas.instances
|
||||
val api = store.client() ?: throw ApiException(401, "Not signed in.")
|
||||
val prefs = store.prefs.first()
|
||||
// A question typed the moment the sheet opened: the model is known first.
|
||||
ready()
|
||||
val now = _state.value
|
||||
val withScreen = now.includeScreen
|
||||
val attachments = buildList {
|
||||
@@ -424,7 +642,7 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
inChat = chatId
|
||||
replyId = sent.reply?.id ?: return@launch
|
||||
} else {
|
||||
val made = api.createChat(text, attachments, model = now.modelId, temporary = prefs.assistantTemporary)
|
||||
val made = api.createChat(text, attachments, model = now.modelId ?: newChatModel, temporary = prefs.assistantTemporary)
|
||||
inChat = made.chat.id
|
||||
replyId = made.reply?.id ?: return@launch
|
||||
_state.update { it.copy(chatId = inChat) }
|
||||
@@ -455,7 +673,7 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
}
|
||||
// The answer was heard to the end: listen for the next thing said. Stopped, a
|
||||
// card waiting, or nothing to read: the conversation ends there.
|
||||
if (_state.value.conversation && heardAll && micAllowed()) listen() else endConversation()
|
||||
if (_state.value.conversation && heardAll && micAllowed() && !locked()) listen() else endConversation()
|
||||
} catch (e: Exception) {
|
||||
_state.update { it.copy(error = context.explain(e), conversation = false) }
|
||||
} finally {
|
||||
@@ -528,11 +746,13 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
override fun newChat() {
|
||||
following?.cancel()
|
||||
speaker.stop()
|
||||
_state.update { it.copy(chatId = null, turns = emptyList(), error = null, busy = false, conversation = false) }
|
||||
// And on the assistant's own model again, not the one of the chat that was continued.
|
||||
_state.update { it.copy(chatId = null, turns = emptyList(), error = null, busy = false, conversation = false, modelId = newChatModel ?: it.modelId) }
|
||||
}
|
||||
|
||||
/** The model: for the chat this sheet is in, changed at once; for a new one, kept for next time. */
|
||||
override fun pickModel(id: String) {
|
||||
newChatModel = id
|
||||
_state.update { it.copy(modelId = id) }
|
||||
scope.launch {
|
||||
context.lembas.instances.savePrefs { it.copy(assistantModel = id) }
|
||||
@@ -560,7 +780,8 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
|
||||
/** Read [words] aloud; true when they were heard to the end. */
|
||||
private suspend fun speak(words: String): Boolean {
|
||||
if (words.isBlank()) return false
|
||||
// Never aloud over the lock screen: an answer is the account's.
|
||||
if (words.isBlank() || locked()) return false
|
||||
return try {
|
||||
val api = context.lembas.instances.client() ?: return false
|
||||
speaker.playToEnd(api.speech(words))
|
||||
@@ -582,7 +803,9 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
speaker.stop()
|
||||
phone.stop()
|
||||
route.release()
|
||||
scope.launch { recorder.stop() }
|
||||
// Not in a coroutine: the scope may be cancelled already, and the microphone must be let go.
|
||||
recorder.stopNow()
|
||||
held = null
|
||||
}
|
||||
|
||||
private suspend fun png(bitmap: Bitmap): ByteArray = withContext(Dispatchers.Default) {
|
||||
@@ -600,18 +823,21 @@ class AssistController(private val context: Context, private val scope: Coroutin
|
||||
private const val TITLE_WAIT_MS = 20_000L
|
||||
private const val TITLE_ASK_MS = 4_000L
|
||||
|
||||
// Listening, for the instance's speech-to-text (the phone's recogniser finds the end of
|
||||
// speech itself). Levels are the RMS of 16-bit samples, 0..1: a room is under 0.01,
|
||||
// a voice near the phone 0.02 and up. Not tuned on many phones: the stop button always works.
|
||||
private const val TICK_MS = 100L
|
||||
private const val SPEAKING = 0.02f
|
||||
private const val QUIET = 0.01f
|
||||
private const val PAUSE_MS = 1_800L
|
||||
private const val SAME_WORDS_MS = 4_500L
|
||||
private const val NOTHING_SAID_MS = 8_000L
|
||||
private const val LONGEST_MS = 120_000L
|
||||
// Listening: how often the end of speech is looked for (EndOfSpeech has the rules and
|
||||
// their numbers), and how often the recording so far is written down.
|
||||
private const val TICK_MS = EndOfSpeech.TICK_MS
|
||||
private const val PARTIAL_EVERY_MS = 1_200L
|
||||
|
||||
/**
|
||||
* The model a new assistant chat starts on: the one [chosen] in Settings while the
|
||||
* instance still has it; else ("Instance default", or a model that is gone) the
|
||||
* account's default, the instance's, or its first.
|
||||
*/
|
||||
fun assistantModelFor(chosen: String, accountDefault: String?, models: List<ModelInfo>): String? {
|
||||
val has = { id: String? -> !id.isNullOrBlank() && models.any { it.id == id } }
|
||||
return chosen.takeIf(has) ?: accountDefault?.takeIf(has) ?: models.firstOrNull { it.default }?.id ?: models.firstOrNull()?.id
|
||||
}
|
||||
|
||||
/** A reply's words, for a voice: its text steps, without the markup. */
|
||||
fun spokenWords(steps: List<Step>): String = plain(steps.filter { it.kind == "text" }.joinToString("\n\n") { it.markdown.orEmpty() })
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ fun AssistPanel(
|
||||
onOpenApp: () -> Unit,
|
||||
onNeedMic: () -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
onUnlock: () -> Unit = {},
|
||||
) {
|
||||
val state by controller.state.collectAsState()
|
||||
AssistSheetFrame(onDismiss = onDismiss) { handle, _ ->
|
||||
@@ -27,6 +28,7 @@ fun AssistPanel(
|
||||
locked = locked,
|
||||
handle = handle,
|
||||
onOpenApp = onOpenApp,
|
||||
onUnlock = onUnlock,
|
||||
onSend = { text -> if (locked) onUnlockAndAsk(text) else controller.ask(text) },
|
||||
onMic = {
|
||||
when {
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.app.assist.AssistStructure
|
||||
import android.app.role.RoleManager
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
@@ -36,6 +35,7 @@ import eu.llembas.android.wake.AssistPresence
|
||||
import eu.llembas.android.wake.wakeLogConnected
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.flow.first
|
||||
@@ -144,6 +144,9 @@ class LembasAssistSession(context: Context) :
|
||||
/** Whether this session's sheet is up, as far as the wake word's pause is concerned. */
|
||||
private var up = false
|
||||
|
||||
/** Over the lock screen: waiting for what is heard, to hand it to the sheet's activity. */
|
||||
private var handing: Job? = null
|
||||
|
||||
override val lifecycle: Lifecycle get() = registry
|
||||
override val savedStateRegistry: SavedStateRegistry get() = saved.savedStateRegistry
|
||||
|
||||
@@ -176,12 +179,12 @@ class LembasAssistSession(context: Context) :
|
||||
AssistPanel(
|
||||
controller = current.value,
|
||||
locked = locked(),
|
||||
onUnlockAndAsk = { text -> handOff(text) },
|
||||
onUnlockAndAsk = { text -> handOff(Held(text, null, spoken = false).takeIf { text.isNotBlank() }) },
|
||||
onOpenApp = {
|
||||
startAssistantActivity(current.value.appIntent())
|
||||
hide()
|
||||
},
|
||||
onNeedMic = { handOff("", listen = true) },
|
||||
onNeedMic = { handOff(null, listen = true) },
|
||||
onDismiss = { hide() },
|
||||
)
|
||||
}
|
||||
@@ -202,8 +205,18 @@ class LembasAssistSession(context: Context) :
|
||||
// One sheet, never two: a sheet the wake word opened as a screen of the app, because
|
||||
// this one was slow to come, goes now that this one is here.
|
||||
AssistActivity.closeWoken()
|
||||
// The wake word asks for the sheet listening, whatever Settings says about opening.
|
||||
controller.opened(locked(), listen = args?.getBoolean(AssistActivity.EXTRA_LISTEN) == true)
|
||||
// The wake word asks for the sheet listening, whatever Settings says about opening --
|
||||
// over the lock screen too, where what it hears is held and not asked.
|
||||
val showing = controller
|
||||
showing.opened(listen = args?.getBoolean(AssistActivity.EXTRA_LISTEN) == true)
|
||||
// A question that waits for the unlock (heard, or typed, over the lock screen) goes to
|
||||
// the sheet's activity, which can ask Android to unlock. Once: Android may call onShow
|
||||
// again while the sheet is up.
|
||||
handing?.cancel()
|
||||
handing = scope.launch {
|
||||
showing.state.first { it.held && locked() }
|
||||
showing.takeHeld()?.let { handOff(it) }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,16 +271,12 @@ class LembasAssistSession(context: Context) :
|
||||
|
||||
/**
|
||||
* Over the lock screen nothing is sent from here: the question goes to [AssistActivity],
|
||||
* which asks Android to unlock first and only then sends it. The microphone's permission
|
||||
* which asks Android to unlock first and only then sends it. It is left in the app's own
|
||||
* memory ([AssistHandOff]) and the intent carries its ticket. The microphone's permission
|
||||
* prompt needs an activity too.
|
||||
*/
|
||||
private fun handOff(text: String, listen: Boolean = false) {
|
||||
startAssistantActivity(
|
||||
Intent(context, AssistActivity::class.java)
|
||||
.putExtra(AssistActivity.EXTRA_QUESTION, text)
|
||||
.putExtra(AssistActivity.EXTRA_LISTEN, listen)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
|
||||
)
|
||||
private fun handOff(question: Held?, listen: Boolean = false) {
|
||||
startAssistantActivity(AssistActivity.handedOver(context, question?.let { AssistHandOff.leave(it) }, listen))
|
||||
hide()
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@ import androidx.compose.material.icons.filled.Forum
|
||||
import androidx.compose.material.icons.filled.History
|
||||
import androidx.compose.material.icons.filled.Keyboard
|
||||
import androidx.compose.material.icons.filled.Lightbulb
|
||||
import androidx.compose.material.icons.filled.LockOpen
|
||||
import androidx.compose.material.icons.filled.Mic
|
||||
import androidx.compose.material.icons.filled.Notifications
|
||||
import androidx.compose.material.icons.filled.ScreenshotMonitor
|
||||
@@ -197,7 +198,10 @@ fun AssistSheetFrame(onDismiss: () -> Unit, content: @Composable ColumnScope.(ha
|
||||
* - **the foot**: Use screen, then the microphone first -- while listening, the words as they are
|
||||
* heard and how loud -- or the words typed, and Send.
|
||||
*
|
||||
* Nothing from the account is on it while the phone is [locked]: no model list, no last chat.
|
||||
* Nothing from the account is on it while the phone is [locked]: no model list, no last chat,
|
||||
* no question asked earlier, no answer, no failure's words. A question heard over the lock
|
||||
* screen waits -- shown as the person's own words where the phone wrote them down, as "Question
|
||||
* heard" where it waits as a recording -- with the way to unlock, which sends it ([onUnlock]).
|
||||
*/
|
||||
@Composable
|
||||
fun ColumnScope.AssistSheetContent(
|
||||
@@ -206,6 +210,7 @@ fun ColumnScope.AssistSheetContent(
|
||||
locked: Boolean,
|
||||
handle: Modifier = Modifier,
|
||||
onOpenApp: () -> Unit = {},
|
||||
onUnlock: () -> Unit = {},
|
||||
onSend: (String) -> Unit = actions::ask,
|
||||
onMic: () -> Unit = actions::listen,
|
||||
) {
|
||||
@@ -267,14 +272,20 @@ fun ColumnScope.AssistSheetContent(
|
||||
Modifier.weight(1f).fillMaxWidth().verticalScroll(scroll).padding(horizontal = 16.dp, vertical = 8.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
) {
|
||||
if (state.empty) {
|
||||
Starting(state, actions, locked)
|
||||
} else {
|
||||
state.turns.forEachIndexed { i, turn ->
|
||||
when {
|
||||
locked && state.held -> Waiting(state.waiting, onUnlock)
|
||||
|
||||
// A conversation that was on the sheet when the phone locked: not for the lock screen.
|
||||
locked && !state.empty -> Text(stringResource(R.string.assist_locked_line), style = MaterialTheme.typography.bodyMedium, color = palette.inkMuted)
|
||||
|
||||
state.empty -> Starting(state, actions, locked)
|
||||
|
||||
else -> state.turns.forEachIndexed { i, turn ->
|
||||
Turn(turn, last = i == state.turns.lastIndex, state, actions, onOpenApp)
|
||||
}
|
||||
}
|
||||
state.error?.let { Text(it, style = MaterialTheme.typography.bodyMedium, color = palette.danger) }
|
||||
// Not over the lock screen: a failure's words may name the instance.
|
||||
if (!locked) state.error?.let { Text(it, style = MaterialTheme.typography.bodyMedium, color = palette.danger) }
|
||||
}
|
||||
|
||||
// The foot.
|
||||
@@ -468,6 +479,41 @@ private fun QuickAction(icon: androidx.compose.ui.graphics.vector.ImageVector, l
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Over the lock screen: the question that was heard, as its bubble, and the one thing to do about
|
||||
* it. Unlocking sends it; nothing is sent and no answer shown before.
|
||||
*/
|
||||
@Composable
|
||||
private fun Waiting(question: String, onUnlock: () -> Unit) {
|
||||
val palette = LocalPalette.current
|
||||
Column(Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
// The words, where the phone itself wrote them down or they were typed; a question the
|
||||
// instance will write down waits as a recording, and there are no words to show yet.
|
||||
Box(Modifier.fillMaxWidth(), contentAlignment = Alignment.CenterEnd) {
|
||||
Surface(color = palette.bubbleUser, contentColor = palette.ink, shape = RoundedCornerShape(20.dp), modifier = Modifier.widthIn(max = 300.dp)) {
|
||||
Text(
|
||||
question.ifBlank { stringResource(R.string.assist_question_heard) },
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
modifier = Modifier.padding(horizontal = 14.dp, vertical = 10.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
Text(
|
||||
stringResource(if (question.isBlank()) R.string.assist_recording_waits_line else R.string.assist_locked_line),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = palette.inkMuted,
|
||||
)
|
||||
AssistChip(
|
||||
onClick = onUnlock,
|
||||
label = { Text(stringResource(R.string.assist_unlock_to_send)) },
|
||||
leadingIcon = { Icon(Icons.Filled.LockOpen, contentDescription = null, modifier = Modifier.size(18.dp)) },
|
||||
colors = AssistChipDefaults.assistChipColors(containerColor = palette.surfaceRaised, leadingIconContentColor = palette.accent),
|
||||
border = BorderStroke(1.dp, palette.border),
|
||||
modifier = Modifier.heightIn(min = 48.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** One question, as a bubble on the right, and its answer at full width -- as in the app's chats. */
|
||||
@Composable
|
||||
private fun Turn(turn: AssistTurn, last: Boolean, state: AssistUiState, actions: AssistActions, onOpenApp: () -> Unit) {
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
package eu.llembas.android.assist
|
||||
|
||||
/**
|
||||
* When to stop listening, for the instance's speech-to-text (which takes a whole recording and
|
||||
* finds no end of speech itself). Fed the microphone's level once a tick ([tick]); apart from
|
||||
* Android, so it is tested with sequences of levels.
|
||||
*
|
||||
* Nothing here is an absolute loudness: a room's own noise differs from phone to phone by more
|
||||
* than a voice differs from a room. The **noise floor** is measured from the first sound on and
|
||||
* followed all the time -- the quietest level of the last two seconds, taken at once when it
|
||||
* falls and slowly, in calm moments, when it rises: the dips between words keep it down while
|
||||
* somebody speaks, and a steady noise (a fan, a car) becomes the floor within a moment. Speech and quiet are
|
||||
* levels relative to it:
|
||||
*
|
||||
* - **speech** begins when the level is well above the floor in [ONSET_TICKS] of the last
|
||||
* [ONSET_WINDOW] ticks -- a voice rises and falls, and one click or knock is not speech;
|
||||
* - listening may begin in the middle of a sentence (the wake word's shape: the person goes
|
||||
* straight on), and a voice that never dips far must not become "the room": the floor rises
|
||||
* only while the sound is calm, and sound that stays above the floor without being steady is
|
||||
* speech;
|
||||
* - once somebody spoke, a **pause** of [PAUSE_MS] back near the floor ends it ([Verdict.Said]);
|
||||
* - when **nothing is said**, it gives up after [NOTHING_SAID_MS] ([Verdict.Nothing]);
|
||||
* - the words written down so far are a second ear: the same words for [SAME_WORDS_MS] end it,
|
||||
* and words count as speech for a quiet voice -- but only when the microphone heard at least
|
||||
* something above the floor, because a speech-to-text model asked to write down silence
|
||||
* invents a sentence;
|
||||
* - and never longer than [LONGEST_MS].
|
||||
*/
|
||||
class EndOfSpeech(private val tickMs: Long = TICK_MS) {
|
||||
enum class Verdict { Listening, Said, Nothing }
|
||||
|
||||
/** The room's own level, as followed so far; 0 until the microphone gave any sound. */
|
||||
var floor = 0f
|
||||
private set
|
||||
|
||||
/** Whether somebody spoke. */
|
||||
var spoke = false
|
||||
private set
|
||||
|
||||
/**
|
||||
* Whether the microphone heard anything above the room at all: only then is the recording
|
||||
* worth writing down while it runs.
|
||||
*/
|
||||
val heardSomething: Boolean get() = spoke || stirred >= STIRRED_TICKS
|
||||
|
||||
private val recent = ArrayDeque<Float>()
|
||||
private var waited = 0L
|
||||
private val loud = ArrayDeque<Boolean>()
|
||||
private var stirred = 0
|
||||
private var aboveRun = 0
|
||||
|
||||
/** The floor is a guess: listening began in the middle of sound louder than any room is taken to be. */
|
||||
private var guessed = false
|
||||
private var overGuess = 0
|
||||
private var quietFor = 0L
|
||||
private var words = ""
|
||||
private var sameWordsFor = 0L
|
||||
|
||||
/** The level from which a sound is speech beginning, and the level under which it is a pause. */
|
||||
private fun speechFrom(): Float = maxOf(floor * SPEECH_RATIO, floor + SPEECH_MARGIN)
|
||||
|
||||
private fun pauseUnder(): Float = maxOf(floor * PAUSE_RATIO, floor + PAUSE_MARGIN)
|
||||
|
||||
/** One tick: the microphone's [level] (0..1, RMS) and the [heard] words written down so far. */
|
||||
fun tick(level: Float, heard: String = ""): Verdict {
|
||||
waited += tickMs
|
||||
// Exact zero before any sound is a microphone that has not given anything yet (or gives
|
||||
// nothing at all): it says nothing about the room. After sound it is silence -- a
|
||||
// headset that gates its noise gives exactly that between sentences -- and so a pause.
|
||||
if (level > 0f) {
|
||||
follow(level)
|
||||
} else if (floor > 0f) {
|
||||
judge(loud = false, above = false)
|
||||
}
|
||||
if (heard != words) {
|
||||
words = heard
|
||||
sameWordsFor = 0
|
||||
} else if (heard.isNotBlank()) {
|
||||
sameWordsFor += tickMs
|
||||
}
|
||||
if (heard.isNotBlank() && stirred >= STIRRED_TICKS) spoke = true
|
||||
return when {
|
||||
spoke && quietFor >= PAUSE_MS -> Verdict.Said
|
||||
spoke && sameWordsFor >= SAME_WORDS_MS -> Verdict.Said
|
||||
!spoke && waited >= NOTHING_SAID_MS -> Verdict.Nothing
|
||||
waited >= LONGEST_MS -> if (spoke) Verdict.Said else Verdict.Nothing
|
||||
else -> Verdict.Listening
|
||||
}
|
||||
}
|
||||
|
||||
private fun follow(level: Float) {
|
||||
recent.addLast(level)
|
||||
if (recent.size > WINDOW_TICKS) recent.removeFirst()
|
||||
val lowest = recent.min()
|
||||
// Steady over the whole window: a noise. Calm in the last half second: no voice now.
|
||||
val steady = recent.size >= CALM_TICKS && recent.max() <= lowest * STEADY_RATIO
|
||||
val last = recent.takeLast(CALM_TICKS)
|
||||
val calm = last.size >= CALM_TICKS && last.max() <= last.min() * STEADY_RATIO
|
||||
// The first sound is the room, unless somebody is already speaking -- then a guess,
|
||||
// until a dip or a calm moment shows the room. After it: down at once; up slowly, and
|
||||
// only while the sound is calm, so a voice does not lift the floor under itself.
|
||||
when {
|
||||
floor == 0f -> {
|
||||
floor = minOf(level, START_MAX)
|
||||
guessed = level > START_MAX
|
||||
}
|
||||
|
||||
lowest < floor -> {
|
||||
floor = lowest
|
||||
guessed = false
|
||||
}
|
||||
|
||||
calm -> {
|
||||
floor += (lowest - floor) * RISE
|
||||
guessed = false
|
||||
}
|
||||
}
|
||||
floor = floor.coerceAtLeast(MIN_FLOOR)
|
||||
judge(loud = level >= speechFrom(), above = level >= pauseUnder())
|
||||
// Sound that stays above the floor and is not steady is a voice: one that never dips
|
||||
// far, or -- while the floor is only a guess -- one that began before the listening did.
|
||||
overGuess = if (guessed && level > floor) overGuess + 1 else 0
|
||||
if ((aboveRun >= SUSTAINED_TICKS || overGuess >= SUSTAINED_TICKS) && !steady) spoke = true
|
||||
}
|
||||
|
||||
/** One tick's sound, judged: [loud] enough to be speech beginning, or at least [above] a pause. */
|
||||
private fun judge(loud: Boolean, above: Boolean) {
|
||||
this.loud.addLast(loud)
|
||||
if (this.loud.size > ONSET_WINDOW) this.loud.removeFirst()
|
||||
if (this.loud.count { it } >= ONSET_TICKS) spoke = true
|
||||
if (above) {
|
||||
stirred++
|
||||
aboveRun++
|
||||
quietFor = 0
|
||||
} else {
|
||||
aboveRun = 0
|
||||
quietFor += tickMs
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TICK_MS = 100L
|
||||
|
||||
/** How long the room's quietest level is looked for: two seconds. */
|
||||
private const val WINDOW_TICKS = 20
|
||||
|
||||
/** How fast the floor follows a room that got louder: a twentieth of the way each tick. */
|
||||
private const val RISE = 0.05f
|
||||
|
||||
/** No microphone is quieter than this; and the most the first sound may claim as "the room". */
|
||||
private const val MIN_FLOOR = 0.0008f
|
||||
private const val START_MAX = 0.02f
|
||||
|
||||
// Speech begins at a little over twice the floor (and at least a small step above it, for
|
||||
// a silent room); a pause is back within 1.6 times of it. Between the two nothing changes.
|
||||
private const val SPEECH_RATIO = 2.2f
|
||||
private const val SPEECH_MARGIN = 0.004f
|
||||
private const val PAUSE_RATIO = 1.6f
|
||||
private const val PAUSE_MARGIN = 0.002f
|
||||
private const val ONSET_TICKS = 3
|
||||
private const val ONSET_WINDOW = 8
|
||||
private const val STIRRED_TICKS = 4
|
||||
|
||||
// Steady, calm: the loudest within half again of the quietest -- over the window, over
|
||||
// the last half second. Sustained: above the floor for a second without a break.
|
||||
private const val CALM_TICKS = 5
|
||||
private const val STEADY_RATIO = 1.5f
|
||||
private const val SUSTAINED_TICKS = 10
|
||||
|
||||
const val PAUSE_MS = 1_500L
|
||||
const val SAME_WORDS_MS = 4_500L
|
||||
const val NOTHING_SAID_MS = 5_000L
|
||||
const val LONGEST_MS = 60_000L
|
||||
}
|
||||
}
|
||||
|
||||
/** What to do about the phone's own recogniser, which finds the end of speech itself -- usually. */
|
||||
enum class PhoneWatch {
|
||||
Wait,
|
||||
|
||||
/** Ask it to stop and give what it has. */
|
||||
Finish,
|
||||
|
||||
/** It did not answer the asking either: take the words it showed. */
|
||||
Take,
|
||||
|
||||
/** Nothing was said, and it has not said so itself. */
|
||||
GiveUp,
|
||||
}
|
||||
|
||||
/**
|
||||
* The watch kept over the phone's recogniser, from how long it has listened ([waitedMs]), whether
|
||||
* it has shown any words ([anyWords]), for how long they have stayed the same ([sameForMs]), and
|
||||
* how long ago it last gave a sign of somebody speaking ([silentForMs]: its "speech began", a
|
||||
* loud level, new words -- not every recogniser shows words while one speaks).
|
||||
* A recogniser normally ends by itself; some never call back, and the sheet would listen for good.
|
||||
* No words and nothing heard for a while gives up; when somebody did speak before that quiet, it
|
||||
* is first asked for what it has.
|
||||
*/
|
||||
fun phoneWatch(waitedMs: Long, anyWords: Boolean, sameForMs: Long, silentForMs: Long = waitedMs): PhoneWatch = when {
|
||||
waitedMs >= EndOfSpeech.LONGEST_MS + PHONE_GRACE_MS -> if (anyWords) PhoneWatch.Take else PhoneWatch.GiveUp
|
||||
waitedMs >= EndOfSpeech.LONGEST_MS -> PhoneWatch.Finish
|
||||
!anyWords && silentForMs >= PHONE_NOTHING_SAID_MS + PHONE_GRACE_MS -> PhoneWatch.GiveUp
|
||||
!anyWords && silentForMs >= PHONE_NOTHING_SAID_MS -> if (silentForMs < waitedMs) PhoneWatch.Finish else PhoneWatch.GiveUp
|
||||
anyWords && sameForMs >= EndOfSpeech.SAME_WORDS_MS + PHONE_GRACE_MS -> PhoneWatch.Take
|
||||
anyWords && sameForMs >= EndOfSpeech.SAME_WORDS_MS && silentForMs >= EndOfSpeech.PAUSE_MS -> PhoneWatch.Finish
|
||||
else -> PhoneWatch.Wait
|
||||
}
|
||||
|
||||
/** Longer than the recogniser's own "no speech" (about five seconds on most): it gets to say so first. */
|
||||
const val PHONE_NOTHING_SAID_MS = 8_000L
|
||||
|
||||
/** How long a recogniser that was asked to stop has to answer. */
|
||||
const val PHONE_GRACE_MS = 2_500L
|
||||
@@ -19,7 +19,8 @@ import kotlinx.coroutines.launch
|
||||
* Speech recognition through the instance (`/v1/audio/transcriptions`). Android requires a
|
||||
* digital assistant to name a recognition service; this is it, and any app that asks the
|
||||
* system's recognizer while LLeMbas is the assistant is answered by the instance's
|
||||
* speech-to-text. Listening ends when the caller says stop, or after [LIMIT_MS].
|
||||
* speech-to-text. Listening ends when the caller says stop, at a pause after speech or when
|
||||
* nothing is said ([EndOfSpeech], as in the assistant's sheet), or after [LIMIT_MS].
|
||||
*/
|
||||
class LembasRecognitionService : RecognitionService() {
|
||||
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
|
||||
@@ -37,7 +38,23 @@ class LembasRecognitionService : RecognitionService() {
|
||||
listener.readyForSpeech(Bundle())
|
||||
listener.beginningOfSpeech()
|
||||
limit = scope.launch {
|
||||
delay(LIMIT_MS)
|
||||
val ear = EndOfSpeech()
|
||||
var waited = 0L
|
||||
while (waited < LIMIT_MS) {
|
||||
delay(EndOfSpeech.TICK_MS)
|
||||
waited += EndOfSpeech.TICK_MS
|
||||
when (ear.tick(recorder.level.value)) {
|
||||
EndOfSpeech.Verdict.Said -> break
|
||||
|
||||
// Nothing said is nothing sent: silence written down is an invented sentence.
|
||||
EndOfSpeech.Verdict.Nothing -> {
|
||||
silent()
|
||||
return@launch
|
||||
}
|
||||
|
||||
EndOfSpeech.Verdict.Listening -> Unit
|
||||
}
|
||||
}
|
||||
finish()
|
||||
}
|
||||
}
|
||||
@@ -52,6 +69,16 @@ class LembasRecognitionService : RecognitionService() {
|
||||
scope.launch { recorder.stop() }
|
||||
}
|
||||
|
||||
/** Nobody spoke: the caller is told so, and nothing is written down. */
|
||||
private fun silent() {
|
||||
val listener = callback ?: return
|
||||
callback = null
|
||||
scope.launch {
|
||||
recorder.stop()
|
||||
listener.error(SpeechRecognizer.ERROR_SPEECH_TIMEOUT)
|
||||
}
|
||||
}
|
||||
|
||||
private fun finish() {
|
||||
val listener = callback ?: return
|
||||
callback = null
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package eu.llembas.android.assist
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import java.security.SecureRandom
|
||||
|
||||
/**
|
||||
* Telling the app's own intents from anybody's. [AssistActivity] is exported -- Android's
|
||||
* `ACTION_ASSIST` and a headset's voice button must reach it -- so any app can start it with any
|
||||
* action and any extras. What only the app's own parts may ask for (open listening, continue the
|
||||
* last chat, turn the screen on, take a handed-over question) is therefore honoured only on an
|
||||
* intent that carries the app's own mark: a random value made once on this phone and kept in the
|
||||
* app's private storage. The widget's and the shortcuts' intents carry it inside a
|
||||
* `PendingIntent` or a shortcut, which no other app can read.
|
||||
*/
|
||||
object OwnIntents {
|
||||
private const val STORE = "own_intents"
|
||||
private const val KEY = "mark"
|
||||
private const val EXTRA_MARK = "eu.llembas.android.OWN"
|
||||
|
||||
@Volatile
|
||||
private var cached: String? = null
|
||||
|
||||
private fun mark(context: Context): String = cached ?: synchronized(this) {
|
||||
cached ?: run {
|
||||
val store = context.applicationContext.getSharedPreferences(STORE, Context.MODE_PRIVATE)
|
||||
val kept = store.getString(KEY, null) ?: newMark().also { store.edit().putString(KEY, it).apply() }
|
||||
cached = kept
|
||||
kept
|
||||
}
|
||||
}
|
||||
|
||||
private fun newMark(): String = ByteArray(24).also { SecureRandom().nextBytes(it) }.joinToString("") { "%02x".format(it) }
|
||||
|
||||
/** [intent], marked as the app's own. */
|
||||
fun own(context: Context, intent: Intent): Intent = intent.putExtra(EXTRA_MARK, mark(context))
|
||||
|
||||
/** Whether [intent] was made by the app itself. */
|
||||
fun isOwn(context: Context, intent: Intent?): Boolean = sameMark(runCatching { intent?.getStringExtra(EXTRA_MARK) }.getOrNull(), mark(context))
|
||||
|
||||
/** Compared in full, whatever differs: how long it takes says nothing about where. */
|
||||
internal fun sameMark(given: String?, kept: String): Boolean {
|
||||
if (given == null || given.length != kept.length) return false
|
||||
var differs = 0
|
||||
for (i in kept.indices) differs = differs or (given[i].code xor kept[i].code)
|
||||
return differs == 0
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A question on its way from one sheet to the other -- the assistant's own sheet hands what was
|
||||
* typed or heard over the lock screen to [AssistActivity], which can ask Android to unlock. It
|
||||
* never travels in the intent: an intent's extras are whatever its sender says, and a question
|
||||
* found there would be asked on the account for any app that put it there. The question waits
|
||||
* here, in the app's own memory; the intent carries only the ticket, good once.
|
||||
*/
|
||||
object AssistHandOff {
|
||||
private var ticket: String? = null
|
||||
private var waiting: Held? = null
|
||||
|
||||
/** Leave [question] here; the ticket to put on the intent. */
|
||||
@Synchronized
|
||||
fun leave(question: Held): String {
|
||||
val made = ByteArray(16).also { SecureRandom().nextBytes(it) }.joinToString("") { "%02x".format(it) }
|
||||
ticket = made
|
||||
waiting = question
|
||||
return made
|
||||
}
|
||||
|
||||
/** The question left under [given], once; nothing for any other ticket, or none. */
|
||||
@Synchronized
|
||||
fun take(given: String?): Held? {
|
||||
val kept = ticket ?: return null
|
||||
if (given == null || !OwnIntents.sameMark(given, kept)) return null
|
||||
val question = waiting
|
||||
ticket = null
|
||||
waiting = null
|
||||
return question
|
||||
}
|
||||
}
|
||||
@@ -107,6 +107,22 @@ class Recorder(private val scope: CoroutineScope) {
|
||||
return if (body.isEmpty()) body else wav(body)
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop and keep nothing, at once and without a coroutine: for when the scope that would
|
||||
* run [stop] is already cancelled (the sheet is going), and the microphone must still be
|
||||
* let go.
|
||||
*/
|
||||
fun stopNow() {
|
||||
val audio = record ?: return
|
||||
record = null
|
||||
job?.cancel()
|
||||
// Stop returns the blocked `read`; the loop then sees it is cancelled, or reads an error.
|
||||
runCatching { audio.stop() }
|
||||
runCatching { audio.release() }
|
||||
_level.value = 0f
|
||||
pcm.reset()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val RATE = 16_000
|
||||
private const val MAX_BYTES = RATE * 2 * 120 // two minutes
|
||||
@@ -255,53 +271,66 @@ private fun words(text: String): List<String> = text.lowercase()
|
||||
class PhoneRecognizer(private val context: Context) {
|
||||
private var recognizer: SpeechRecognizer? = null
|
||||
|
||||
fun start(onPartial: (String) -> Unit, onLevel: (Float) -> Unit, onResult: (String) -> Unit, onFail: (Int) -> Unit) {
|
||||
/** [onActive]: a sign that somebody is speaking -- "speech began", or a loud level -- for a recogniser that shows no words meanwhile. */
|
||||
fun start(onPartial: (String) -> Unit, onLevel: (Float) -> Unit, onResult: (String) -> Unit, onFail: (Int) -> Unit, onActive: () -> Unit = {}) {
|
||||
stop()
|
||||
startWith(onDevice(context), onPartial, onLevel, onResult, onFail)
|
||||
startWith(onDevice(context), Heard(onPartial, onLevel, onResult, onFail, onActive))
|
||||
}
|
||||
|
||||
private class Heard(
|
||||
val onPartial: (String) -> Unit,
|
||||
val onLevel: (Float) -> Unit,
|
||||
val onResult: (String) -> Unit,
|
||||
val onFail: (Int) -> Unit,
|
||||
val onActive: () -> Unit,
|
||||
)
|
||||
|
||||
// `onFail`, not `onError`: inside the listener below that name is the listener's own method.
|
||||
private fun startWith(onDevice: Boolean, onPartial: (String) -> Unit, onLevel: (Float) -> Unit, onResult: (String) -> Unit, onFail: (Int) -> Unit) {
|
||||
private fun startWith(onDevice: Boolean, to: Heard) {
|
||||
val other = component(context)
|
||||
val made = when {
|
||||
onDevice && Build.VERSION.SDK_INT >= 31 -> SpeechRecognizer.createOnDeviceSpeechRecognizer(context)
|
||||
other != null -> SpeechRecognizer.createSpeechRecognizer(context, other)
|
||||
else -> return onFail(SpeechRecognizer.ERROR_CLIENT)
|
||||
else -> return to.onFail(SpeechRecognizer.ERROR_CLIENT)
|
||||
}
|
||||
recognizer = made
|
||||
made.setRecognitionListener(
|
||||
object : RecognitionListener {
|
||||
override fun onReadyForSpeech(params: Bundle?) {}
|
||||
|
||||
override fun onBeginningOfSpeech() {}
|
||||
override fun onBeginningOfSpeech() = to.onActive()
|
||||
|
||||
// About -2 dB in silence to 10 dB speaking: the meter's 0..1.
|
||||
override fun onRmsChanged(rmsdB: Float) = onLevel(((rmsdB + 2f) / 12f).coerceIn(0f, 1f))
|
||||
override fun onRmsChanged(rmsdB: Float) {
|
||||
val level = ((rmsdB + 2f) / 12f).coerceIn(0f, 1f)
|
||||
to.onLevel(level)
|
||||
if (level >= LOUD) to.onActive()
|
||||
}
|
||||
|
||||
override fun onBufferReceived(buffer: ByteArray?) {}
|
||||
|
||||
override fun onEndOfSpeech() = onLevel(0f)
|
||||
override fun onEndOfSpeech() = to.onLevel(0f)
|
||||
|
||||
override fun onError(error: Int) {
|
||||
// The on-device recogniser lacks this language: another app's may have it.
|
||||
if (onDevice && other != null && (error == LANGUAGE_NOT_SUPPORTED || error == LANGUAGE_UNAVAILABLE)) {
|
||||
stop()
|
||||
startWith(false, onPartial, onLevel, onResult, onFail)
|
||||
startWith(false, to)
|
||||
return
|
||||
}
|
||||
stop()
|
||||
onFail(error)
|
||||
to.onFail(error)
|
||||
}
|
||||
|
||||
override fun onResults(results: Bundle?) {
|
||||
val text = results?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)?.firstOrNull().orEmpty()
|
||||
stop()
|
||||
onResult(text)
|
||||
to.onResult(text)
|
||||
}
|
||||
|
||||
override fun onPartialResults(partialResults: Bundle?) {
|
||||
partialResults?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)?.firstOrNull()
|
||||
?.takeIf { it.isNotBlank() }?.let(onPartial)
|
||||
?.takeIf { it.isNotBlank() }?.let(to.onPartial)
|
||||
}
|
||||
|
||||
override fun onEvent(eventType: Int, params: Bundle?) {}
|
||||
@@ -311,6 +340,10 @@ class PhoneRecognizer(private val context: Context) {
|
||||
Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
||||
.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
|
||||
.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true)
|
||||
// How long a silence ends it: a hint, which not every recogniser takes -- the
|
||||
// sheet keeps its own watch as well (phoneWatch).
|
||||
.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, EndOfSpeech.PAUSE_MS)
|
||||
.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS, EndOfSpeech.PAUSE_MS)
|
||||
.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, context.packageName),
|
||||
)
|
||||
}
|
||||
@@ -333,6 +366,9 @@ class PhoneRecognizer(private val context: Context) {
|
||||
private const val LANGUAGE_NOT_SUPPORTED = 12
|
||||
private const val LANGUAGE_UNAVAILABLE = 13
|
||||
|
||||
/** Half of the meter: a level that is a voice, not a room. */
|
||||
private const val LOUD = 0.5f
|
||||
|
||||
private fun onDevice(context: Context): Boolean = Build.VERSION.SDK_INT >= 31 && SpeechRecognizer.isOnDeviceRecognitionAvailable(context)
|
||||
|
||||
/** Another app's recogniser -- never LLeMbas's own, which would send it back to the instance. */
|
||||
|
||||
@@ -104,7 +104,11 @@ class ShareActivity :
|
||||
into
|
||||
} else {
|
||||
val prefs = store.prefs.first()
|
||||
val made = api.createChat(message, files, model = prefs.assistantModel.ifBlank { null })
|
||||
// The assistant's model while the instance still has it; a model that is
|
||||
// gone is not asked for (the instance's default answers instead).
|
||||
val chosen = prefs.assistantModel
|
||||
val gone = chosen.isNotBlank() && runCatching { api.models() }.getOrNull()?.none { it.id == chosen } == true
|
||||
val made = api.createChat(message, files, model = chosen.takeIf { it.isNotBlank() && !gone })
|
||||
store.savePrefs {
|
||||
it.copy(
|
||||
lastAssistChat = made.chat.id,
|
||||
|
||||
@@ -48,6 +48,7 @@ import androidx.compose.material.icons.filled.Notifications
|
||||
import androidx.compose.material.icons.filled.NotificationsActive
|
||||
import androidx.compose.material.icons.filled.Palette
|
||||
import androidx.compose.material.icons.filled.PhoneAndroid
|
||||
import androidx.compose.material.icons.filled.Psychology
|
||||
import androidx.compose.material.icons.filled.RecordVoiceOver
|
||||
import androidx.compose.material.icons.filled.Science
|
||||
import androidx.compose.material.icons.filled.ScreenLockPortrait
|
||||
@@ -93,6 +94,7 @@ import eu.llembas.android.AppLanguage
|
||||
import eu.llembas.android.BuildConfig
|
||||
import eu.llembas.android.R
|
||||
import eu.llembas.android.actions.NavApp
|
||||
import eu.llembas.android.api.ModelInfo
|
||||
import eu.llembas.android.assist.LembasAssistService
|
||||
import eu.llembas.android.assist.PhoneRecognizer
|
||||
import eu.llembas.android.auth.Instance
|
||||
@@ -122,6 +124,7 @@ import eu.llembas.android.wake.WakeWordService
|
||||
import eu.llembas.android.wake.WakeWords
|
||||
import eu.llembas.android.wake.wakeAttemptWords
|
||||
import eu.llembas.android.wake.wakeTitle
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -136,6 +139,7 @@ interface SettingsActions {
|
||||
fun notificationSettings() {}
|
||||
fun assistantSettings() {}
|
||||
fun assistantTemporary(on: Boolean) {}
|
||||
fun assistantModel(id: String) {}
|
||||
fun voiceInput(value: String) {}
|
||||
fun assistantListens(on: Boolean) {}
|
||||
fun assistantConversation(on: Boolean) {}
|
||||
@@ -195,6 +199,8 @@ data class SettingsState(
|
||||
val notificationsBuild: Boolean = false,
|
||||
/** The navigation apps installed: NavApp ids. */
|
||||
val navApps: List<String> = emptyList(),
|
||||
/** The instance's models, for Settings › Assistant › Assistant model; empty until (or unless) it said them. */
|
||||
val assistantModels: List<ModelInfo> = emptyList(),
|
||||
)
|
||||
|
||||
@Composable
|
||||
@@ -218,6 +224,18 @@ fun SettingsScreen(onBack: () -> Unit, onAddInstance: () -> Unit) {
|
||||
}
|
||||
clock = SystemClock.elapsedRealtime()
|
||||
}
|
||||
// The instance's models, for the assistant's: asked for each time Settings opens on an instance.
|
||||
var models by remember { mutableStateOf(emptyList<ModelInfo>()) }
|
||||
LaunchedEffect(active?.id) {
|
||||
models = try {
|
||||
store.client()?.models().orEmpty()
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
} catch (e: Exception) {
|
||||
// Not reachable now: the row keeps what was chosen and offers the instance's default.
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
var pushNote by remember { mutableStateOf<String?>(null) }
|
||||
var updateNote by remember { mutableStateOf<String?>(null) }
|
||||
var updateFound by remember { mutableStateOf<UpdateOffer?>(null) }
|
||||
@@ -279,6 +297,10 @@ fun SettingsScreen(onBack: () -> Unit, onAddInstance: () -> Unit) {
|
||||
scope.launch { store.savePrefs { it.copy(assistantTemporary = on) } }
|
||||
}
|
||||
|
||||
override fun assistantModel(id: String) {
|
||||
scope.launch { store.savePrefs { it.copy(assistantModel = id) } }
|
||||
}
|
||||
|
||||
override fun voiceInput(value: String) {
|
||||
scope.launch { store.savePrefs { it.copy(voiceInput = value) } }
|
||||
}
|
||||
@@ -420,6 +442,7 @@ fun SettingsScreen(onBack: () -> Unit, onAddInstance: () -> Unit) {
|
||||
notificationAccess = NotificationAccess.granted(context),
|
||||
notificationsBuild = NotificationAccess.AVAILABLE,
|
||||
navApps = remember { NavApp.installedApps(context).map { it.id } },
|
||||
assistantModels = models,
|
||||
),
|
||||
actions,
|
||||
onBack,
|
||||
@@ -444,6 +467,15 @@ fun SettingsContent(state: SettingsState, actions: SettingsActions, onBack: () -
|
||||
})
|
||||
}
|
||||
}
|
||||
var choosingModel by remember { mutableStateOf(false) }
|
||||
if (choosingModel) {
|
||||
ModalBottomSheet(onDismissRequest = { choosingModel = false }, sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)) {
|
||||
AssistantModelChoices(state, onPick = {
|
||||
choosingModel = false
|
||||
actions.assistantModel(it)
|
||||
})
|
||||
}
|
||||
}
|
||||
if (choosingLanguage) {
|
||||
ModalBottomSheet(onDismissRequest = { choosingLanguage = false }, sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)) {
|
||||
LanguageChoices(state.prefs, onPick = {
|
||||
@@ -567,6 +599,15 @@ fun SettingsContent(state: SettingsState, actions: SettingsActions, onBack: () -
|
||||
onClick = actions::assistantSettings,
|
||||
)
|
||||
Rule()
|
||||
// The model the assistant's new chats start on: the instance's default may be
|
||||
// a large one, and a spoken question wants a quick answer.
|
||||
SettingRow(
|
||||
Icons.Filled.Psychology,
|
||||
stringResource(R.string.assistant_model),
|
||||
subtitle = assistantModelLabel(state),
|
||||
onClick = { choosingModel = true },
|
||||
)
|
||||
Rule()
|
||||
SettingRow(
|
||||
Icons.Filled.Timer,
|
||||
stringResource(R.string.assistant_temporary),
|
||||
@@ -577,6 +618,7 @@ fun SettingsContent(state: SettingsState, actions: SettingsActions, onBack: () -
|
||||
SettingRow(
|
||||
Icons.Filled.Mic,
|
||||
stringResource(R.string.assistant_listens),
|
||||
badge = stringResource(R.string.experimental),
|
||||
onClick = { actions.assistantListens(!state.prefs.assistantListens) },
|
||||
trailing = { Switch(checked = state.prefs.assistantListens, onCheckedChange = actions::assistantListens) },
|
||||
)
|
||||
@@ -592,6 +634,7 @@ fun SettingsContent(state: SettingsState, actions: SettingsActions, onBack: () -
|
||||
Icons.Filled.Forum,
|
||||
stringResource(R.string.assistant_conversation),
|
||||
subtitle = stringResource(R.string.assistant_conversation_line),
|
||||
badge = stringResource(R.string.experimental),
|
||||
enabled = state.prefs.readAloudSpoken,
|
||||
onClick = { actions.assistantConversation(!state.prefs.assistantConversation) },
|
||||
trailing = {
|
||||
@@ -603,6 +646,13 @@ fun SettingsContent(state: SettingsState, actions: SettingsActions, onBack: () -
|
||||
},
|
||||
)
|
||||
}
|
||||
// Said plainly: which parts of the voice assistant are not to be relied on yet.
|
||||
Text(
|
||||
stringResource(R.string.assistant_voice_experimental_line),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = palette.inkMuted,
|
||||
modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 8.dp),
|
||||
)
|
||||
Text(
|
||||
stringResource(R.string.assistant_samsung),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
@@ -706,11 +756,15 @@ enum class WakeChoice { Greeting, Name, Sensitivity }
|
||||
internal fun WakeWordGroup(state: SettingsState, actions: SettingsActions, onChoose: (WakeChoice) -> Unit) {
|
||||
val palette = LocalPalette.current
|
||||
val on = state.prefs.wakeWord && state.wakeAvailable
|
||||
Group(stringResource(R.string.wake_word)) {
|
||||
Group(stringResource(R.string.wake_word), badge = stringResource(R.string.experimental)) {
|
||||
SettingRow(
|
||||
Icons.Filled.Hearing,
|
||||
stringResource(R.string.wake_word_listen),
|
||||
subtitle = stringResource(if (state.wakeAvailable) R.string.wake_word_line else R.string.wake_word_unavailable),
|
||||
subtitle = if (state.wakeAvailable) {
|
||||
stringResource(R.string.wake_word_line) + "\n" + stringResource(R.string.wake_experimental_line)
|
||||
} else {
|
||||
stringResource(R.string.wake_word_unavailable)
|
||||
},
|
||||
enabled = state.wakeAvailable,
|
||||
onClick = { actions.wakeWord(!on) },
|
||||
trailing = { Switch(checked = on, enabled = state.wakeAvailable, onCheckedChange = actions::wakeWord) },
|
||||
@@ -924,21 +978,38 @@ internal fun NotificationSummaryGroup(state: SettingsState, actions: SettingsAct
|
||||
}
|
||||
}
|
||||
|
||||
/** A group's header and its rows; [badge] is a label beside the title ("Experimental"). */
|
||||
@Composable
|
||||
private fun Group(title: String, content: @Composable () -> Unit) {
|
||||
private fun Group(title: String, badge: String? = null, content: @Composable () -> Unit) {
|
||||
val palette = LocalPalette.current
|
||||
Text(
|
||||
title,
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = palette.accent,
|
||||
modifier = Modifier.padding(start = 16.dp, top = 24.dp, bottom = 8.dp),
|
||||
)
|
||||
// The title gives when the two do not fit; the label keeps its size.
|
||||
Row(Modifier.padding(start = 16.dp, end = 16.dp, top = 24.dp, bottom = 8.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
title,
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = palette.accent,
|
||||
modifier = Modifier.weight(1f, fill = false),
|
||||
)
|
||||
if (badge != null) {
|
||||
Spacer(Modifier.width(8.dp))
|
||||
Badge(badge)
|
||||
}
|
||||
}
|
||||
Surface(shape = RoundedCornerShape(20.dp), color = palette.surfaceRaised, contentColor = palette.ink, modifier = Modifier.fillMaxWidth()) {
|
||||
Column { content() }
|
||||
}
|
||||
}
|
||||
|
||||
/** A small label: "Experimental". */
|
||||
@Composable
|
||||
private fun Badge(text: String) {
|
||||
val palette = LocalPalette.current
|
||||
Surface(shape = RoundedCornerShape(8.dp), color = palette.accentSoft, contentColor = palette.accent) {
|
||||
Text(text, style = MaterialTheme.typography.labelSmall, maxLines = 1, modifier = Modifier.padding(horizontal = 8.dp, vertical = 2.dp))
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Rule() = HorizontalDivider(color = LocalPalette.current.border, modifier = Modifier.padding(start = 56.dp))
|
||||
|
||||
@@ -955,6 +1026,7 @@ private fun SettingRow(
|
||||
tint: Color? = null,
|
||||
enabled: Boolean = true,
|
||||
showIcon: Boolean = true,
|
||||
badge: String? = null,
|
||||
trailing: (@Composable () -> Unit)? = null,
|
||||
) {
|
||||
val palette = LocalPalette.current
|
||||
@@ -973,6 +1045,8 @@ private fun SettingRow(
|
||||
Spacer(Modifier.width(16.dp))
|
||||
Column(Modifier.weight(1f)) {
|
||||
Text(title, style = MaterialTheme.typography.bodyLarge, color = ink)
|
||||
// On a line of its own, under the title: nothing has to fit beside words that wrap.
|
||||
badge?.let { Box(Modifier.padding(top = 2.dp, bottom = 2.dp)) { Badge(it) } }
|
||||
subtitle?.let { Text(it, style = MaterialTheme.typography.bodyMedium, color = palette.inkMuted) }
|
||||
}
|
||||
if (trailing != null) {
|
||||
@@ -1109,6 +1183,40 @@ fun WakeChoices(which: WakeChoice, prefs: Prefs, onPick: ((SettingsActions) -> U
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* What the assistant's model row says: the chosen model by its name, or "Instance default" --
|
||||
* also for a model the instance no longer has, since that is what the assistant then uses.
|
||||
*/
|
||||
@Composable
|
||||
private fun assistantModelLabel(state: SettingsState): String {
|
||||
val chosen = state.prefs.assistantModel
|
||||
val model = state.assistantModels.firstOrNull { it.id == chosen }
|
||||
// While the list is not read yet, or could not be: the choice as it was saved.
|
||||
return when {
|
||||
chosen.isBlank() -> stringResource(R.string.assistant_model_default)
|
||||
model != null -> model.name.ifBlank { model.id }
|
||||
state.assistantModels.isEmpty() -> chosen
|
||||
else -> stringResource(R.string.assistant_model_default)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings › Assistant › Assistant model, as a sheet: "Instance default" (the account's default
|
||||
* model, as in a new chat in the app), then the instance's models. The choice is the model a new
|
||||
* assistant chat starts on, from every way in -- the sheet, the wake word, Share.
|
||||
*/
|
||||
@Composable
|
||||
fun AssistantModelChoices(state: SettingsState, onPick: (String) -> Unit) {
|
||||
val chosen = state.prefs.assistantModel.takeIf { id -> state.assistantModels.any { it.id == id } }.orEmpty()
|
||||
val choices = listOf(
|
||||
Choice(INSTANCE_DEFAULT, stringResource(R.string.assistant_model_default), stringResource(R.string.assistant_model_default_line), chosen.isEmpty()),
|
||||
) + state.assistantModels.map { Choice(it.id, it.name.ifBlank { it.id }, null, it.id == chosen) }
|
||||
ChoiceList(stringResource(R.string.assistant_model), choices) { id -> onPick(if (id == INSTANCE_DEFAULT) "" else id) }
|
||||
}
|
||||
|
||||
/** The list's key for "Instance default": a key cannot be empty, and no model is named so. */
|
||||
private const val INSTANCE_DEFAULT = " default"
|
||||
|
||||
private data class Choice(val id: String, val title: String, val subtitle: String?, val chosen: Boolean)
|
||||
|
||||
/** A sheet's list of choices: a title, then rows of words that give and a radio button that keeps its size. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.12. Do not edit.
|
||||
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.13. Do not edit.
|
||||
package eu.llembas.android.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
@@ -3,6 +3,7 @@ package eu.llembas.android.widget
|
||||
import android.app.PendingIntent
|
||||
import android.appwidget.AppWidgetManager
|
||||
import android.appwidget.AppWidgetProvider
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.ShortcutInfo
|
||||
@@ -34,10 +35,21 @@ class AskWidget : AppWidgetProvider() {
|
||||
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT,
|
||||
)
|
||||
|
||||
private companion object {
|
||||
const val REQUEST_ASK = 1
|
||||
const val REQUEST_LISTEN = 2
|
||||
const val REQUEST_CONTINUE = 3
|
||||
companion object {
|
||||
private const val REQUEST_ASK = 1
|
||||
private const val REQUEST_LISTEN = 2
|
||||
private const val REQUEST_CONTINUE = 3
|
||||
|
||||
/**
|
||||
* Give every placed widget its buttons again. Nothing on it changes -- but the intents
|
||||
* behind the buttons carry the app's own mark ([eu.llembas.android.assist.OwnIntents]),
|
||||
* and a widget placed by an older version has buttons without it.
|
||||
*/
|
||||
fun refresh(context: Context) {
|
||||
val manager = AppWidgetManager.getInstance(context) ?: return
|
||||
val ids = runCatching { manager.getAppWidgetIds(ComponentName(context, AskWidget::class.java)) }.getOrNull() ?: return
|
||||
if (ids.isNotEmpty()) AskWidget().onUpdate(context, manager, ids)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -372,6 +372,9 @@
|
||||
<string name="settings_assistant">Asistent</string>
|
||||
<string name="assistant_explained">Nastavte LLeMbas jako digitálního asistenta telefonu: zvolte ho v Výchozí aplikace › Digitální asistent. Podržení tlačítka napájení, gesto asistenta nebo zkratka na zamykací obrazovce ho pak otevře přes to, co je právě na obrazovce.</string>
|
||||
<string name="assistant_open_settings">Otevřít nastavení asistenta</string>
|
||||
<string name="assistant_model">Model asistenta</string>
|
||||
<string name="assistant_model_default">Výchozí model instance</string>
|
||||
<string name="assistant_model_default_line">Model, se kterým začínají vaše nové konverzace. Je-li na mluvenou otázku příliš pomalý, vyberte níže rychlejší.</string>
|
||||
<string name="assistant_samsung">Na telefonech Samsung: Nastavení › Pokročilé funkce › Boční tlačítko › Stisknutí a podržení › Digitální asistent.</string>
|
||||
<string name="assistant_temporary">Konverzace s asistentem jsou dočasné</string>
|
||||
<string name="assistant_read_aloud">Přečíst odpověď nahlas, když se zeptáte hlasem</string>
|
||||
@@ -421,12 +424,19 @@
|
||||
<string name="assist_say_it">Řekněte to a odmlčte se</string>
|
||||
<string name="assist_type">Raději psát</string>
|
||||
<string name="assist_writing_down">Zapisuji, co jste řekli…</string>
|
||||
<string name="assist_unlock_to_send">Odemknout a odeslat</string>
|
||||
<string name="assist_question_heard">Otázka zaznamenána</string>
|
||||
<string name="assist_recording_waits_line">Telefon je zamčený. Vaše otázka čeká v tomto telefonu jako nahrávka; nic se neodeslalo. Po odemknutí se odešle vaší instanci, která ji přepíše a odpoví.</string>
|
||||
<string name="assist_locked_line">Telefon je zamčený. Dokud ho neodemknete, nic se neodešle a žádná odpověď se nezobrazí.</string>
|
||||
<string name="assist_conversation">Rozhovor</string>
|
||||
<string name="assist_conversation_line">Po každé odpovědi znovu poslouchám. Řekněte „stop“ a skončíme.</string>
|
||||
<string name="assist_conversation_end">Ukončit</string>
|
||||
<string name="assist_stop_words">stop|dost|to je vše|to je všechno|konec|nashledanou|díky to je vše|zrušit|stop stop</string>
|
||||
<string name="assistant_conversation">Pokračovat v mluveném rozhovoru</string>
|
||||
<string name="assistant_conversation_line">Po přečtení mluvené odpovědi asistent znovu poslouchá — dokud neřeknete „stop“, neklepnete na Ukončit nebo pár sekund nic neřeknete. Funguje i se sluchátky.</string>
|
||||
<string name="experimental">Experimentální</string>
|
||||
<string name="wake_experimental_line">Novinka, zatím vyzkoušená jen na několika telefonech. Může frázi přeslechnout, spustit se omylem, nebo vás uslyšet a asistenta přesto neotevřít.</string>
|
||||
<string name="assistant_voice_experimental_line">Experimentální: samočinné poslouchání po otevření asistenta, rozpoznání, že jste domluvili, a mluvený rozhovor jsou nové a zatím nefungují dobře na každém telefonu. Napsat otázku a tlačítko mikrofonu fungují vždy.</string>
|
||||
<string name="assist_wake_word_hint">Budicí slovo jen pokud chcete: Nastavení › Asistent › Budicí slovo zapne vlastní slovo LLeMbas, přímo v tomto telefonu.</string>
|
||||
<string name="channel_wake">Budicí slovo</string>
|
||||
<string name="wake_word">Budicí slovo</string>
|
||||
|
||||
@@ -372,6 +372,9 @@
|
||||
<string name="settings_assistant">Assistent</string>
|
||||
<string name="assistant_explained">Machen Sie LLeMbas zum digitalen Assistenten des Telefons: Wählen Sie ihn unter Standard-Apps › Digitaler Assistent. Das Halten der Einschalttaste, die Assistenzgeste oder die Verknüpfung auf dem Sperrbildschirm öffnet ihn dann über allem, was gerade angezeigt wird.</string>
|
||||
<string name="assistant_open_settings">Assistenten-Einstellungen öffnen</string>
|
||||
<string name="assistant_model">Modell des Assistenten</string>
|
||||
<string name="assistant_model_default">Standard der Instanz</string>
|
||||
<string name="assistant_model_default_line">Das Modell, mit dem deine neuen Chats beginnen. Ist es für eine gesprochene Frage zu langsam, wähle unten ein schnelleres.</string>
|
||||
<string name="assistant_samsung">Auf Samsung-Telefonen: Einstellungen › Erweiterte Funktionen › Seitentaste › Gedrückt halten › Digitaler Assistent.</string>
|
||||
<string name="assistant_temporary">Assistenten-Chats sind temporär</string>
|
||||
<string name="assistant_read_aloud">Antwort vorlesen, wenn per Sprache gefragt wurde</string>
|
||||
@@ -421,12 +424,19 @@
|
||||
<string name="assist_say_it">Sprechen Sie, dann kurz Pause</string>
|
||||
<string name="assist_type">Lieber tippen</string>
|
||||
<string name="assist_writing_down">Ihr Gesagtes wird aufgeschrieben…</string>
|
||||
<string name="assist_unlock_to_send">Entsperren und senden</string>
|
||||
<string name="assist_question_heard">Frage aufgenommen</string>
|
||||
<string name="assist_recording_waits_line">Das Telefon ist gesperrt. Deine Frage wartet als Aufnahme auf diesem Telefon; es wurde nichts gesendet. Nach dem Entsperren geht sie an deine Instanz, die sie aufschreibt und beantwortet.</string>
|
||||
<string name="assist_locked_line">Das Telefon ist gesperrt. Bis du es entsperrst, wird nichts gesendet und keine Antwort angezeigt.</string>
|
||||
<string name="assist_conversation">Im Gespräch</string>
|
||||
<string name="assist_conversation_line">Nach jeder Antwort höre ich wieder zu. Sag „Stopp“, um zu beenden.</string>
|
||||
<string name="assist_conversation_end">Beenden</string>
|
||||
<string name="assist_stop_words">stopp|stop|das wars|das war\'s|das ist alles|genug|ende|tschüss|auf wiedersehen|danke das wars|abbrechen</string>
|
||||
<string name="assistant_conversation">Ein gesprochenes Gespräch fortführen</string>
|
||||
<string name="assistant_conversation_line">Nachdem eine gesprochene Antwort vorgelesen wurde, hört der Assistent wieder zu — bis du „Stopp“ sagst, auf Beenden tippst oder ein paar Sekunden nichts sagst. Funktioniert mit einem Headset.</string>
|
||||
<string name="experimental">Experimentell</string>
|
||||
<string name="wake_experimental_line">Neu und bisher nur auf wenigen Telefonen erprobt. Es kann den Satz überhören, versehentlich starten oder dich hören und den Assistenten trotzdem nicht öffnen.</string>
|
||||
<string name="assistant_voice_experimental_line">Experimentell: Das selbstständige Zuhören beim Öffnen des Assistenten, das Erkennen, wann du fertig gesprochen hast, und das gesprochene Gespräch sind neu und funktionieren noch nicht auf jedem Telefon gut. Eine Frage tippen und die Mikrofontaste funktionieren immer.</string>
|
||||
<string name="assist_wake_word_hint">Kein Aktivierungswort, außer du willst eines: Einstellungen › Assistent › Aktivierungswort schaltet das eigene von LLeMbas ein, auf diesem Telefon.</string>
|
||||
<string name="channel_wake">Aktivierungswort</string>
|
||||
<string name="wake_word">Aktivierungswort</string>
|
||||
|
||||
@@ -372,6 +372,9 @@
|
||||
<string name="settings_assistant">Asistente</string>
|
||||
<string name="assistant_explained">Convierta LLeMbas en el asistente digital del teléfono: elíjalo en Aplicaciones predeterminadas › App de asistencia digital. Mantener pulsado el botón de encendido, el gesto de asistencia o el acceso directo de la pantalla de bloqueo lo abrirá entonces sobre lo que haya en pantalla.</string>
|
||||
<string name="assistant_open_settings">Abrir los ajustes del asistente</string>
|
||||
<string name="assistant_model">Modelo del asistente</string>
|
||||
<string name="assistant_model_default">Predeterminado de la instancia</string>
|
||||
<string name="assistant_model_default_line">El modelo con el que empiezan tus chats nuevos. Si es demasiado lento para una pregunta hablada, elige abajo uno más rápido.</string>
|
||||
<string name="assistant_samsung">En los teléfonos Samsung: Ajustes › Funciones avanzadas › Botón lateral › Mantener pulsado › Asistente digital.</string>
|
||||
<string name="assistant_temporary">Los chats del asistente son temporales</string>
|
||||
<string name="assistant_read_aloud">Leer la respuesta en voz alta cuando se pregunte por voz</string>
|
||||
@@ -421,12 +424,19 @@
|
||||
<string name="assist_say_it">Dígalo y haga una pausa</string>
|
||||
<string name="assist_type">Escribir en su lugar</string>
|
||||
<string name="assist_writing_down">Escribiendo lo que ha dicho…</string>
|
||||
<string name="assist_unlock_to_send">Desbloquear para enviar</string>
|
||||
<string name="assist_question_heard">Pregunta oída</string>
|
||||
<string name="assist_recording_waits_line">El teléfono está bloqueado. Tu pregunta espera en este teléfono como grabación; no se ha enviado nada. Al desbloquear se envía a tu instancia para transcribirla y responderla.</string>
|
||||
<string name="assist_locked_line">El teléfono está bloqueado. Hasta que lo desbloquees no se envía nada ni se muestra ninguna respuesta.</string>
|
||||
<string name="assist_conversation">En conversación</string>
|
||||
<string name="assist_conversation_line">Vuelvo a escuchar después de cada respuesta. Di «para» para terminar.</string>
|
||||
<string name="assist_conversation_end">Terminar</string>
|
||||
<string name="assist_stop_words">para|stop|basta|eso es todo|ya está|adiós|terminar|fin|gracias eso es todo|cancelar</string>
|
||||
<string name="assistant_conversation">Mantener una conversación hablada</string>
|
||||
<string name="assistant_conversation_line">Después de leer en voz alta una respuesta hablada, el asistente vuelve a escuchar, hasta que digas «para», toques Terminar o no digas nada durante unos segundos. Funciona con auriculares.</string>
|
||||
<string name="experimental">Experimental</string>
|
||||
<string name="wake_experimental_line">Nuevo y probado por ahora en pocos teléfonos. Puede no oír la frase, activarse por error u oírte y aun así no abrir el asistente.</string>
|
||||
<string name="assistant_voice_experimental_line">Experimental: escuchar por sí solo al abrir el asistente, notar cuándo has terminado de hablar y la conversación hablada son nuevos y todavía no funcionan bien en todos los teléfonos. Escribir una pregunta y el botón del micrófono funcionan siempre.</string>
|
||||
<string name="assist_wake_word_hint">Sin palabra de activación salvo que quieras una: Ajustes › Asistente › Palabra de activación activa la propia de LLeMbas, en este teléfono.</string>
|
||||
<string name="channel_wake">Palabra de activación</string>
|
||||
<string name="wake_word">Palabra de activación</string>
|
||||
|
||||
@@ -372,6 +372,9 @@
|
||||
<string name="settings_assistant">Assistant</string>
|
||||
<string name="assistant_explained">Faites de LLeMbas l\'assistant numérique du téléphone : choisissez-le dans Applications par défaut › Application d\'assistance numérique. Maintenir le bouton d\'alimentation, le geste d\'assistance ou le raccourci de l\'écran de verrouillage l\'ouvrira alors par-dessus ce qui est affiché.</string>
|
||||
<string name="assistant_open_settings">Ouvrir les paramètres de l\'assistant</string>
|
||||
<string name="assistant_model">Modèle de l’assistant</string>
|
||||
<string name="assistant_model_default">Modèle par défaut de l’instance</string>
|
||||
<string name="assistant_model_default_line">Le modèle avec lequel commencent vos nouvelles discussions. S’il est trop lent pour une question orale, choisissez-en un plus rapide ci-dessous.</string>
|
||||
<string name="assistant_samsung">Sur les téléphones Samsung : Paramètres › Fonctions avancées › Bouton latéral › Maintenir enfoncé › Assistant numérique.</string>
|
||||
<string name="assistant_temporary">Les conversations de l\'assistant sont temporaires</string>
|
||||
<string name="assistant_read_aloud">Lire la réponse à voix haute en cas de question orale</string>
|
||||
@@ -421,12 +424,19 @@
|
||||
<string name="assist_say_it">Dites-le, puis marquez une pause</string>
|
||||
<string name="assist_type">Taper plutôt</string>
|
||||
<string name="assist_writing_down">Transcription de ce que vous avez dit…</string>
|
||||
<string name="assist_unlock_to_send">Déverrouiller pour envoyer</string>
|
||||
<string name="assist_question_heard">Question entendue</string>
|
||||
<string name="assist_recording_waits_line">Le téléphone est verrouillé. Votre question attend sur ce téléphone sous forme d’enregistrement ; rien n’a été envoyé. Au déverrouillage, elle est envoyée à votre instance pour être transcrite et recevoir une réponse.</string>
|
||||
<string name="assist_locked_line">Le téléphone est verrouillé. Rien n’est envoyé et aucune réponse n’est affichée tant que vous ne l’avez pas déverrouillé.</string>
|
||||
<string name="assist_conversation">En conversation</string>
|
||||
<string name="assist_conversation_line">J’écoute à nouveau après chaque réponse. Dites « stop » pour arrêter.</string>
|
||||
<string name="assist_conversation_end">Terminer</string>
|
||||
<string name="assist_stop_words">stop|arrête|c\'est tout|ça suffit|au revoir|fin|terminé|merci c\'est tout|annuler</string>
|
||||
<string name="assistant_conversation">Poursuivre une conversation orale</string>
|
||||
<string name="assistant_conversation_line">Après la lecture d’une réponse orale, l’assistant écoute à nouveau — jusqu’à ce que vous disiez « stop », touchiez Terminer ou ne disiez rien pendant quelques secondes. Fonctionne avec un casque.</string>
|
||||
<string name="experimental">Expérimental</string>
|
||||
<string name="wake_experimental_line">Nouveau, et essayé sur peu de téléphones pour l’instant. Il peut ne pas entendre la phrase, se déclencher par erreur, ou vous entendre sans pour autant ouvrir l’assistant.</string>
|
||||
<string name="assistant_voice_experimental_line">Expérimental : l’écoute automatique à l’ouverture de l’assistant, la détection de la fin de votre phrase et la conversation orale sont nouvelles et ne fonctionnent pas encore bien sur tous les téléphones. Écrire une question et le bouton du micro fonctionnent toujours.</string>
|
||||
<string name="assist_wake_word_hint">Pas de mot d’activation sauf si vous en voulez un : Paramètres › Assistant › Mot d’activation active celui de LLeMbas, sur ce téléphone.</string>
|
||||
<string name="channel_wake">Mot d’activation</string>
|
||||
<string name="wake_word">Mot d’activation</string>
|
||||
|
||||
@@ -372,6 +372,9 @@
|
||||
<string name="settings_assistant">Asszisztens</string>
|
||||
<string name="assistant_explained">Tegye az LLeMbas-t a telefon digitális asszisztensévé: válassza ki az Alapértelmezett alkalmazások › Digitális asszisztens alkalmazás alatt. A bekapcsológomb lenyomva tartása, az asszisztens-gesztus vagy a lezárási képernyő parancsikonja ezután a képernyőn lévő tartalom felett nyitja meg.</string>
|
||||
<string name="assistant_open_settings">Asszisztens beállításainak megnyitása</string>
|
||||
<string name="assistant_model">Az asszisztens modellje</string>
|
||||
<string name="assistant_model_default">A példány alapértelmezése</string>
|
||||
<string name="assistant_model_default_line">Az a modell, amellyel az új csevegéseid indulnak. Ha egy kimondott kérdéshez túl lassú, válassz lent gyorsabbat.</string>
|
||||
<string name="assistant_samsung">Samsung telefonokon: Beállítások › Speciális funkciók › Oldalgomb › Nyomva tartás › Digitális asszisztens.</string>
|
||||
<string name="assistant_temporary">Az asszisztenses csevegések ideiglenesek</string>
|
||||
<string name="assistant_read_aloud">Olvassa fel a választ, ha hangos kérdés érkezett</string>
|
||||
@@ -421,12 +424,19 @@
|
||||
<string name="assist_say_it">Mondja, aztán tartson szünetet</string>
|
||||
<string name="assist_type">Inkább gépelés</string>
|
||||
<string name="assist_writing_down">Lejegyzem, amit mondott…</string>
|
||||
<string name="assist_unlock_to_send">Feloldás és küldés</string>
|
||||
<string name="assist_question_heard">Kérdés rögzítve</string>
|
||||
<string name="assist_recording_waits_line">A telefon zárolva van. A kérdésed felvételként ezen a telefonon vár; semmi sem ment el. Feloldás után a példányodhoz kerül, amely leírja és megválaszolja.</string>
|
||||
<string name="assist_locked_line">A telefon zárolva van. Amíg fel nem oldod, semmi sem megy el, és válasz sem jelenik meg.</string>
|
||||
<string name="assist_conversation">Beszélgetés</string>
|
||||
<string name="assist_conversation_line">Minden válasz után újra figyelek. A befejezéshez mondd: „állj”.</string>
|
||||
<string name="assist_conversation_end">Befejezés</string>
|
||||
<string name="assist_stop_words">állj|stop|ennyi|ennyi volt|elég|vége|viszlát|köszönöm ennyi|mégse</string>
|
||||
<string name="assistant_conversation">Szóbeli beszélgetés folytatása</string>
|
||||
<string name="assistant_conversation_line">Egy szóbeli válasz felolvasása után az asszisztens újra figyel — amíg nem mondod, hogy „állj”, nem koppintasz a Befejezésre, vagy néhány másodpercig nem szólsz. Headsettel is működik.</string>
|
||||
<string name="experimental">Kísérleti</string>
|
||||
<string name="wake_experimental_line">Új, és eddig csak néhány telefonon próbáltuk ki. Előfordulhat, hogy nem hallja meg a kifejezést, tévedésből elindul, vagy meghall, és mégsem nyitja meg az asszisztenst.</string>
|
||||
<string name="assistant_voice_experimental_line">Kísérleti: az önálló hallgatás az asszisztens megnyitásakor, annak észlelése, hogy befejezted a beszédet, és a szóbeli beszélgetés új, és még nem minden telefonon működik jól. Kérdést beírni és a mikrofon gombot használni mindig lehet.</string>
|
||||
<string name="assist_wake_word_hint">Nincs ébresztőszó, hacsak nem kérsz: Beállítások › Asszisztens › Ébresztőszó bekapcsolja a LLeMbas sajátját, ezen a telefonon.</string>
|
||||
<string name="channel_wake">Ébresztőszó</string>
|
||||
<string name="wake_word">Ébresztőszó</string>
|
||||
|
||||
@@ -372,6 +372,9 @@
|
||||
<string name="settings_assistant">Assistente</string>
|
||||
<string name="assistant_explained">Rendi LLeMbas l\'assistente digitale del telefono: selezionalo in App predefinite › App di assistenza digitale. Tenendo premuto il tasto di accensione, il gesto di assistenza o la scorciatoia della schermata di blocco lo apre quindi sopra qualsiasi cosa sia a schermo.</string>
|
||||
<string name="assistant_open_settings">Apri le impostazioni dell\'assistente</string>
|
||||
<string name="assistant_model">Modello dell’assistente</string>
|
||||
<string name="assistant_model_default">Predefinito dell’istanza</string>
|
||||
<string name="assistant_model_default_line">Il modello con cui iniziano le tue nuove chat. Se è troppo lento per una domanda a voce, scegline sotto uno più rapido.</string>
|
||||
<string name="assistant_samsung">Sui telefoni Samsung: Impostazioni › Funzioni avanzate › Tasto laterale › Pressione prolungata › Assistente digitale.</string>
|
||||
<string name="assistant_temporary">Le chat dell\'assistente sono temporanee</string>
|
||||
<string name="assistant_read_aloud">Leggi la risposta ad alta voce quando la domanda è vocale</string>
|
||||
@@ -421,12 +424,19 @@
|
||||
<string name="assist_say_it">Lo dica, poi faccia una pausa</string>
|
||||
<string name="assist_type">Scrivi invece</string>
|
||||
<string name="assist_writing_down">Trascrivo ciò che ha detto…</string>
|
||||
<string name="assist_unlock_to_send">Sblocca per inviare</string>
|
||||
<string name="assist_question_heard">Domanda sentita</string>
|
||||
<string name="assist_recording_waits_line">Il telefono è bloccato. La tua domanda attende su questo telefono come registrazione; non è stato inviato nulla. Allo sblocco viene inviata alla tua istanza per essere trascritta e ricevere risposta.</string>
|
||||
<string name="assist_locked_line">Il telefono è bloccato. Finché non lo sblocchi non viene inviato nulla e non viene mostrata alcuna risposta.</string>
|
||||
<string name="assist_conversation">In conversazione</string>
|
||||
<string name="assist_conversation_line">Ascolto di nuovo dopo ogni risposta. Di’ «basta» per finire.</string>
|
||||
<string name="assist_conversation_end">Termina</string>
|
||||
<string name="assist_stop_words">basta|stop|è tutto|fine|ciao|arrivederci|grazie è tutto|annulla|smetti</string>
|
||||
<string name="assistant_conversation">Continuare una conversazione a voce</string>
|
||||
<string name="assistant_conversation_line">Dopo aver letto ad alta voce una risposta a voce, l’assistente ascolta di nuovo, finché non dici «basta», tocchi Termina o non dici nulla per qualche secondo. Funziona con le cuffie.</string>
|
||||
<string name="experimental">Sperimentale</string>
|
||||
<string name="wake_experimental_line">Nuovo e provato finora su pochi telefoni. Può non sentire la frase, attivarsi per errore, oppure sentirti e non aprire comunque l’assistente.</string>
|
||||
<string name="assistant_voice_experimental_line">Sperimentale: l’ascolto automatico all’apertura dell’assistente, il riconoscimento di quando hai finito di parlare e la conversazione a voce sono nuovi e non funzionano ancora bene su tutti i telefoni. Scrivere una domanda e il pulsante del microfono funzionano sempre.</string>
|
||||
<string name="assist_wake_word_hint">Nessuna parola di attivazione, a meno che tu non la voglia: Impostazioni › Assistente › Parola di attivazione attiva quella di LLeMbas, su questo telefono.</string>
|
||||
<string name="channel_wake">Parola di attivazione</string>
|
||||
<string name="wake_word">Parola di attivazione</string>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.12 (moria). Do not edit. -->
|
||||
<!-- Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.13 (moria). Do not edit. -->
|
||||
<resources>
|
||||
<color name="token_bg">#FF0B0D10</color>
|
||||
<color name="token_surface">#FF11151A</color>
|
||||
|
||||
@@ -372,6 +372,9 @@
|
||||
<string name="settings_assistant">Asystent</string>
|
||||
<string name="assistant_explained">Ustaw LLeMbas jako cyfrowego asystenta telefonu: wybierz go w Domyślne aplikacje › Aplikacja asystenta cyfrowego. Przytrzymanie przycisku zasilania, gest asystenta lub skrót z ekranu blokady otwiera go wtedy nad tym, co jest na ekranie.</string>
|
||||
<string name="assistant_open_settings">Otwórz ustawienia asystenta</string>
|
||||
<string name="assistant_model">Model asystenta</string>
|
||||
<string name="assistant_model_default">Domyślny model instancji</string>
|
||||
<string name="assistant_model_default_line">Model, od którego zaczynają się Twoje nowe czaty. Jeśli jest za wolny na pytanie zadane głosem, wybierz poniżej szybszy.</string>
|
||||
<string name="assistant_samsung">W telefonach Samsung: Ustawienia › Funkcje zaawansowane › Przycisk boczny › Naciśnięcie i przytrzymanie › Asystent cyfrowy.</string>
|
||||
<string name="assistant_temporary">Czaty asystenta są tymczasowe</string>
|
||||
<string name="assistant_read_aloud">Odczytaj odpowiedź na głos, gdy pytanie było głosowe</string>
|
||||
@@ -421,12 +424,19 @@
|
||||
<string name="assist_say_it">Powiedz to i zrób pauzę</string>
|
||||
<string name="assist_type">Zamiast tego pisz</string>
|
||||
<string name="assist_writing_down">Zapisuję, co powiedziałeś…</string>
|
||||
<string name="assist_unlock_to_send">Odblokuj, aby wysłać</string>
|
||||
<string name="assist_question_heard">Pytanie usłyszane</string>
|
||||
<string name="assist_recording_waits_line">Telefon jest zablokowany. Twoje pytanie czeka w tym telefonie jako nagranie; nic nie zostało wysłane. Po odblokowaniu trafi do Twojej instancji, która je zapisze i na nie odpowie.</string>
|
||||
<string name="assist_locked_line">Telefon jest zablokowany. Dopóki go nie odblokujesz, nic nie zostanie wysłane ani żadna odpowiedź nie zostanie pokazana.</string>
|
||||
<string name="assist_conversation">Rozmowa</string>
|
||||
<string name="assist_conversation_line">Po każdej odpowiedzi słucham znowu. Powiedz „stop”, aby zakończyć.</string>
|
||||
<string name="assist_conversation_end">Zakończ</string>
|
||||
<string name="assist_stop_words">stop|wystarczy|to wszystko|koniec|do widzenia|dzięki to wszystko|anuluj|przestań</string>
|
||||
<string name="assistant_conversation">Prowadź rozmowę głosową</string>
|
||||
<string name="assistant_conversation_line">Po odczytaniu odpowiedzi na głos asystent znów słucha — dopóki nie powiesz „stop”, nie dotkniesz Zakończ albo nie będziesz milczeć przez kilka sekund. Działa ze słuchawkami.</string>
|
||||
<string name="experimental">Eksperymentalne</string>
|
||||
<string name="wake_experimental_line">Nowość, sprawdzona na razie na niewielu telefonach. Może nie usłyszeć frazy, uruchomić się przez pomyłkę albo usłyszeć Cię i mimo to nie otworzyć asystenta.</string>
|
||||
<string name="assistant_voice_experimental_line">Eksperymentalne: samoczynne słuchanie po otwarciu asystenta, rozpoznawanie, że skończyłeś mówić, oraz rozmowa głosowa są nowe i nie na każdym telefonie działają jeszcze dobrze. Wpisanie pytania i przycisk mikrofonu działają zawsze.</string>
|
||||
<string name="assist_wake_word_hint">Bez słowa aktywującego, chyba że chcesz: Ustawienia › Asystent › Słowo aktywujące włącza własne słowo LLeMbas, na tym telefonie.</string>
|
||||
<string name="channel_wake">Słowo aktywujące</string>
|
||||
<string name="wake_word">Słowo aktywujące</string>
|
||||
|
||||
@@ -372,6 +372,9 @@
|
||||
<string name="settings_assistant">Asistent</string>
|
||||
<string name="assistant_explained">Nastavte LLeMbas ako digitálneho asistenta telefónu: zvoľte ho v Predvolené aplikácie › Digitálny asistent. Podržanie tlačidla napájania, gesto asistenta alebo skratka na uzamknutej obrazovke ho potom otvorí nad tým, čo je práve na obrazovke.</string>
|
||||
<string name="assistant_open_settings">Otvoriť nastavenia asistenta</string>
|
||||
<string name="assistant_model">Model asistenta</string>
|
||||
<string name="assistant_model_default">Predvolený model inštancie</string>
|
||||
<string name="assistant_model_default_line">Model, s ktorým sa začínajú vaše nové konverzácie. Ak je na hovorenú otázku príliš pomalý, vyberte nižšie rýchlejší.</string>
|
||||
<string name="assistant_samsung">Na telefónoch Samsung: Nastavenia › Rozšírené funkcie › Tlačidlo na boku › Stlačenie a podržanie › Digitálny asistent.</string>
|
||||
<string name="assistant_temporary">Konverzácie s asistentom sú dočasné</string>
|
||||
<string name="assistant_read_aloud">Prečítať odpoveď nahlas, keď sa spýtate hlasom</string>
|
||||
@@ -421,12 +424,19 @@
|
||||
<string name="assist_say_it">Povedzte to a odmlčte sa</string>
|
||||
<string name="assist_type">Radšej písať</string>
|
||||
<string name="assist_writing_down">Zapisujem, čo ste povedali…</string>
|
||||
<string name="assist_unlock_to_send">Odomknúť a odoslať</string>
|
||||
<string name="assist_question_heard">Otázka zaznamenaná</string>
|
||||
<string name="assist_recording_waits_line">Telefón je zamknutý. Vaša otázka čaká v tomto telefóne ako nahrávka; nič sa neodoslalo. Po odomknutí sa odošle vašej inštancii, ktorá ju prepíše a odpovie.</string>
|
||||
<string name="assist_locked_line">Telefón je zamknutý. Kým ho neodomknete, nič sa neodošle a žiadna odpoveď sa nezobrazí.</string>
|
||||
<string name="assist_conversation">Rozhovor</string>
|
||||
<string name="assist_conversation_line">Po každej odpovedi znova počúvam. Povedzte „stop“ a skončíme.</string>
|
||||
<string name="assist_conversation_end">Ukončiť</string>
|
||||
<string name="assist_stop_words">stop|dosť|to je všetko|koniec|dovidenia|ďakujem to je všetko|zrušiť|prestaň</string>
|
||||
<string name="assistant_conversation">Pokračovať v hovorenom rozhovore</string>
|
||||
<string name="assistant_conversation_line">Po prečítaní hovorenej odpovede asistent znova počúva — kým nepoviete „stop“, neťuknete na Ukončiť alebo pár sekúnd nič nepoviete. Funguje aj so slúchadlami.</string>
|
||||
<string name="experimental">Experimentálne</string>
|
||||
<string name="wake_experimental_line">Novinka, zatiaľ vyskúšaná len na niekoľkých telefónoch. Môže frázu prepočuť, spustiť sa omylom, alebo vás začuť a asistenta aj tak neotvoriť.</string>
|
||||
<string name="assistant_voice_experimental_line">Experimentálne: samočinné počúvanie po otvorení asistenta, rozpoznanie, že ste dohovorili, a hovorený rozhovor sú nové a zatiaľ nefungujú dobre na každom telefóne. Napísať otázku a tlačidlo mikrofónu fungujú vždy.</string>
|
||||
<string name="assist_wake_word_hint">Budiace slovo len ak chcete: Nastavenia › Asistent › Budiace slovo zapne vlastné slovo LLeMbas, priamo v tomto telefóne.</string>
|
||||
<string name="channel_wake">Budiace slovo</string>
|
||||
<string name="wake_word">Budiace slovo</string>
|
||||
|
||||
@@ -374,6 +374,9 @@
|
||||
<string name="settings_assistant">Assistant</string>
|
||||
<string name="assistant_explained">Make LLeMbas the phone\'s digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen\'s shortcut opens it over whatever is on screen.</string>
|
||||
<string name="assistant_open_settings">Open the assistant settings</string>
|
||||
<string name="assistant_model">Assistant model</string>
|
||||
<string name="assistant_model_default">Instance default</string>
|
||||
<string name="assistant_model_default_line">The model your new chats start on. Choose a quick one below if it is too slow for a spoken question.</string>
|
||||
<string name="assistant_samsung">On Samsung phones: Settings › Advanced features › Side button › Press and hold › Digital assistant.</string>
|
||||
<string name="assistant_temporary">Assistant chats are temporary</string>
|
||||
<string name="assistant_read_aloud">Read the answer aloud when asked by voice</string>
|
||||
@@ -423,12 +426,19 @@
|
||||
<string name="assist_say_it">Say it, then pause</string>
|
||||
<string name="assist_type">Type instead</string>
|
||||
<string name="assist_writing_down">Writing down what you said…</string>
|
||||
<string name="assist_unlock_to_send">Unlock to send</string>
|
||||
<string name="assist_question_heard">Question heard</string>
|
||||
<string name="assist_recording_waits_line">The phone is locked. Your question waits on this phone as a recording; nothing has been sent. Unlocking sends it to your instance to be written down and answered.</string>
|
||||
<string name="assist_locked_line">The phone is locked. Nothing is sent, and no answer is shown, until you unlock it.</string>
|
||||
<string name="assist_conversation">In conversation</string>
|
||||
<string name="assist_conversation_line">I listen again after each answer. Say “stop” to end.</string>
|
||||
<string name="assist_conversation_end">End</string>
|
||||
<string name="assist_stop_words">stop|that\'s all|that is all|that\'s it|goodbye|bye|enough|end|thank you that\'s all|cancel</string>
|
||||
<string name="assistant_conversation">Keep a spoken conversation going</string>
|
||||
<string name="assistant_conversation_line">After a spoken answer is read aloud, the assistant listens again — until you say “stop”, tap End, or say nothing for a few seconds. Works with a headset.</string>
|
||||
<string name="experimental">Experimental</string>
|
||||
<string name="wake_experimental_line">New, and tried on few phones so far. It may miss the phrase, start by mistake, or hear you and still not open the assistant.</string>
|
||||
<string name="assistant_voice_experimental_line">Experimental: listening by itself when the assistant opens, noticing when you have finished speaking, and the spoken conversation are new and do not work well on every phone yet. Typing a question and the microphone button always work.</string>
|
||||
<string name="assist_wake_word_hint">No wake word unless you want one: Settings › Assistant › Wake word turns on LLeMbas\'s own, on this phone.</string>
|
||||
<string name="channel_wake">Wake word</string>
|
||||
<string name="wake_word">Wake word</string>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.12 (shire). Do not edit. -->
|
||||
<!-- Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at v2.0.0-beta.13 (shire). Do not edit. -->
|
||||
<resources>
|
||||
<color name="token_bg">#FFF1EAD6</color>
|
||||
<color name="token_surface">#FFF8F3E5</color>
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
package eu.llembas.android
|
||||
|
||||
import eu.llembas.android.api.LiveReply
|
||||
import eu.llembas.android.api.ModelInfo
|
||||
import eu.llembas.android.api.Step
|
||||
import eu.llembas.android.api.Tail
|
||||
import eu.llembas.android.assist.AssistActivity
|
||||
import eu.llembas.android.assist.AssistController
|
||||
import eu.llembas.android.assist.AssistHandOff
|
||||
import eu.llembas.android.assist.AssistTurn
|
||||
import eu.llembas.android.assist.AssistUiState
|
||||
import eu.llembas.android.assist.Held
|
||||
import eu.llembas.android.assist.LockedStart
|
||||
import eu.llembas.android.assist.Opening
|
||||
import eu.llembas.android.assist.Recorder
|
||||
import eu.llembas.android.assist.SheetStop
|
||||
import eu.llembas.android.assist.isStopPhrase
|
||||
import eu.llembas.android.assist.lockedStart
|
||||
import eu.llembas.android.assist.settle
|
||||
import eu.llembas.android.assist.usePhoneRecognizer
|
||||
import eu.llembas.android.auth.Prefs
|
||||
@@ -53,6 +61,85 @@ class AssistTest {
|
||||
assertEquals("Because.", earlier.steps.single().markdown)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theAssistantsModelIsTheOneChosenInSettings() {
|
||||
val models = listOf(ModelInfo("large"), ModelInfo("standard", default = true), ModelInfo("quick"))
|
||||
// The choice, whatever the account's and the instance's defaults are.
|
||||
assertEquals("quick", AssistController.assistantModelFor("quick", "large", models))
|
||||
// "Instance default": the account's default, as a new chat in the app starts.
|
||||
assertEquals("large", AssistController.assistantModelFor("", "large", models))
|
||||
// No account default (or one that is gone): the instance's, then its first.
|
||||
assertEquals("standard", AssistController.assistantModelFor("", null, models))
|
||||
assertEquals("standard", AssistController.assistantModelFor("", "retired", models))
|
||||
assertEquals("large", AssistController.assistantModelFor("", null, models.map { it.copy(default = false) }))
|
||||
// A chosen model the instance no longer has falls back the same way, and none is none.
|
||||
assertEquals("large", AssistController.assistantModelFor("retired", "large", models))
|
||||
assertEquals(null, AssistController.assistantModelFor("quick", null, emptyList()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overTheLockScreenAWayInThatMeansToSpeakStaysAndListens() {
|
||||
// The wake word with the screen off: nobody is there to unlock. It listens; sending waits.
|
||||
assertEquals(LockedStart.Listen, lockedStart(locked = true, Opening.Listen, question = false, micAllowed = true))
|
||||
// A question handed over (heard by the assistant's own sheet, or typed there) is held, not dropped.
|
||||
assertEquals(LockedStart.Hold, lockedStart(locked = true, Opening.Sheet, question = true, micAllowed = true))
|
||||
assertEquals(LockedStart.Hold, lockedStart(locked = true, Opening.Listen, question = true, micAllowed = false))
|
||||
// Anything else over the lock screen asks to unlock first, as before: the plain sheet,
|
||||
// the last chat (which is the account's), and the microphone's permission prompt.
|
||||
assertEquals(LockedStart.Unlock, lockedStart(locked = true, Opening.Sheet, question = false, micAllowed = true))
|
||||
assertEquals(LockedStart.Unlock, lockedStart(locked = true, Opening.Continue, question = false, micAllowed = true))
|
||||
assertEquals(LockedStart.Unlock, lockedStart(locked = true, Opening.Listen, question = false, micAllowed = false))
|
||||
// Unlocked, the way in decides alone.
|
||||
for (opening in Opening.entries) {
|
||||
assertEquals(LockedStart.Go, lockedStart(locked = false, opening, question = false, micAllowed = true))
|
||||
assertEquals(LockedStart.Go, lockedStart(locked = false, opening, question = true, micAllowed = false))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun onlyTheAppsOwnIntentsAskForMoreThanTheSheet() {
|
||||
val voiceButton = "android.intent.action.VOICE_COMMAND"
|
||||
val handsFree = "android.speech.action.VOICE_SEARCH_HANDS_FREE"
|
||||
// The app's own: the widget's microphone, the last chat, the session's "listen".
|
||||
assertEquals(Opening.Listen, Opening.of(AssistActivity.ACTION_LISTEN, listenExtra = false, own = true))
|
||||
assertEquals(Opening.Continue, Opening.of(AssistActivity.ACTION_CONTINUE, listenExtra = false, own = true))
|
||||
assertEquals(Opening.Listen, Opening.of(null, listenExtra = true, own = true))
|
||||
// The same from any other app: just the sheet.
|
||||
assertEquals(Opening.Sheet, Opening.of(AssistActivity.ACTION_LISTEN, listenExtra = true, own = false))
|
||||
assertEquals(Opening.Sheet, Opening.of(AssistActivity.ACTION_CONTINUE, listenExtra = false, own = false))
|
||||
assertEquals(Opening.Sheet, Opening.of("android.intent.action.ASSIST", listenExtra = true, own = false))
|
||||
// Android's own actions for a headset's button are anybody's, and listen.
|
||||
assertEquals(Opening.Listen, Opening.of(voiceButton, listenExtra = false, own = false))
|
||||
assertEquals(Opening.Listen, Opening.of(handsFree, listenExtra = false, own = false))
|
||||
assertEquals(Opening.Sheet, Opening.of("android.intent.action.ASSIST", listenExtra = false, own = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aHandedOverQuestionIsTakenOnceAndOnlyWithItsTicket() {
|
||||
val question = Held("How far is it to the next town?", null, spoken = true)
|
||||
val ticket = AssistHandOff.leave(question)
|
||||
// No ticket, a made-up one, one of another length: nothing.
|
||||
assertEquals(null, AssistHandOff.take(null))
|
||||
assertEquals(null, AssistHandOff.take("0".repeat(ticket.length)))
|
||||
assertEquals(null, AssistHandOff.take(ticket.dropLast(1)))
|
||||
// The ticket: the question, once.
|
||||
assertTrue(AssistHandOff.take(ticket) === question)
|
||||
assertEquals(null, AssistHandOff.take(ticket))
|
||||
// A newer question takes the older one's place, and the older ticket is worth nothing.
|
||||
val older = AssistHandOff.leave(question)
|
||||
val newer = AssistHandOff.leave(Held("", ByteArray(4), spoken = true))
|
||||
assertTrue(older != newer)
|
||||
assertEquals(null, AssistHandOff.take(older))
|
||||
assertTrue(AssistHandOff.take(newer)?.wav != null)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aQuestionWaitsAsWordsOrAsARecording() {
|
||||
assertFalse(AssistUiState().held)
|
||||
assertTrue(AssistUiState(waiting = "Why?").held)
|
||||
assertTrue(AssistUiState(waitingRecording = true).held)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aVoiceReadsOnlyTheWords() {
|
||||
val steps = listOf(
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
package eu.llembas.android
|
||||
|
||||
import eu.llembas.android.assist.EndOfSpeech
|
||||
import eu.llembas.android.assist.EndOfSpeech.Verdict
|
||||
import eu.llembas.android.assist.PHONE_GRACE_MS
|
||||
import eu.llembas.android.assist.PHONE_NOTHING_SAID_MS
|
||||
import eu.llembas.android.assist.PhoneWatch
|
||||
import eu.llembas.android.assist.phoneWatch
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
/** When the sheet stops listening, from sequences of microphone levels (one each 100 ms). */
|
||||
class EndOfSpeechTest {
|
||||
/** How it ended and after how many milliseconds. */
|
||||
private data class Ended(val verdict: Verdict, val ms: Long)
|
||||
|
||||
/**
|
||||
* Feed [start], then [rest] over and over, until a verdict; [words] are what the instance
|
||||
* has written down by each tick.
|
||||
*/
|
||||
private fun listen(start: List<Float>, rest: List<Float>, words: (Int) -> String = { "" }): Ended {
|
||||
val ear = EndOfSpeech()
|
||||
var tick = 0
|
||||
while (tick < 5_000) {
|
||||
val level = if (tick < start.size) start[tick] else rest[(tick - start.size) % rest.size]
|
||||
val verdict = ear.tick(level, words(tick))
|
||||
tick++
|
||||
if (verdict != Verdict.Listening) return Ended(verdict, tick * EndOfSpeech.TICK_MS)
|
||||
}
|
||||
error("it never stopped listening")
|
||||
}
|
||||
|
||||
/** A steady noise around [level]: no two moments quite the same. */
|
||||
private fun noise(level: Float): List<Float> = listOf(1.0f, 0.9f, 1.1f, 0.95f, 1.15f, 0.85f, 1.05f).map { it * level }
|
||||
|
||||
/** Two seconds of a voice whose loudest moments are [peak]: it rises and falls between words. */
|
||||
private fun voice(peak: Float): List<Float> {
|
||||
val second = listOf(0.6f, 1.0f, 0.8f, 0.3f, 0.9f, 1.0f, 0.5f, 0.7f, 1.0f, 0.4f)
|
||||
return (second + second).map { it * peak }
|
||||
}
|
||||
|
||||
private fun still(level: Float, ticks: Int): List<Float> = List(ticks) { level }
|
||||
|
||||
/** Ended as said, a pause after [start]'s last sound: not before it was over, and not long after. */
|
||||
private fun assertEndsAfter(start: List<Float>, ended: Ended, late: Long = 400) {
|
||||
val over = start.size * EndOfSpeech.TICK_MS
|
||||
assertEquals(Verdict.Said, ended.verdict)
|
||||
assertTrue("ended at ${ended.ms}, speech over at $over", ended.ms > over + EndOfSpeech.PAUSE_MS - 400 && ended.ms <= over + EndOfSpeech.PAUSE_MS + late)
|
||||
}
|
||||
|
||||
/** A voice that never dips far: its quietest moments are six tenths of its loudest. One second. */
|
||||
private fun steadyVoice(peak: Float): List<Float> = listOf(1.0f, 0.7f, 0.9f, 0.6f, 1.0f, 0.8f, 0.65f, 0.95f, 0.75f, 0.6f).map { it * peak }
|
||||
|
||||
@Test
|
||||
fun aSilentRoomWithNothingSaidGivesUpSoon() {
|
||||
assertEquals(Ended(Verdict.Nothing, EndOfSpeech.NOTHING_SAID_MS), listen(emptyList(), still(0.001f, 1)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aNoisyRoomWithNothingSaidGivesUpAsSoon() {
|
||||
// Louder than any fixed "this is a voice" level could allow for: the noise is the floor.
|
||||
assertEquals(Ended(Verdict.Nothing, EndOfSpeech.NOTHING_SAID_MS), listen(emptyList(), noise(0.03f)))
|
||||
assertEquals(Ended(Verdict.Nothing, EndOfSpeech.NOTHING_SAID_MS), listen(emptyList(), noise(0.012f)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aMicrophoneThatGivesNothingAtAllGivesUpToo() {
|
||||
assertEquals(Ended(Verdict.Nothing, EndOfSpeech.NOTHING_SAID_MS), listen(emptyList(), still(0f, 1)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun speechThenAPauseEndsAfterThePause() {
|
||||
val start = still(0.001f, 5) + voice(0.06f)
|
||||
assertEndsAfter(start, listen(start, still(0.001f, 1)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun speechInANoisyRoomEndsAfterThePauseToo() {
|
||||
val start = noise(0.03f) + voice(0.12f)
|
||||
// The room is louder than the first guess allows for: found a moment after the voice ends.
|
||||
assertEndsAfter(start, listen(start, noise(0.03f)), late = 800)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aRoomThatIsNeverQuietByAFixedLevelStillEnds() {
|
||||
// The room sits at 0.015: above what used to count as quiet, so it listened to the limit.
|
||||
val start = still(0.015f, 5) + voice(0.06f)
|
||||
assertEndsAfter(start, listen(start, still(0.015f, 1)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun speakingAtOnceIsHeard() {
|
||||
// No quiet moment first to measure the room by: the first dip between words gives it.
|
||||
for (peak in listOf(0.05f, 0.08f, 0.3f)) {
|
||||
val start = voice(peak)
|
||||
assertEndsAfter(start, listen(start, still(0.002f, 1)))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun silenceFromAHeadsetThatGatesItsNoiseIsAPause() {
|
||||
// After speech the microphone gives exact zeros: that is quiet, not "no microphone".
|
||||
val start = still(0.001f, 5) + voice(0.06f)
|
||||
assertEndsAfter(start, listen(start, still(0f, 1)))
|
||||
val atOnce = voice(0.06f)
|
||||
assertEndsAfter(atOnce, listen(atOnce, still(0f, 1)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun listeningThatBeginsInTheMiddleOfASentenceHearsIt() {
|
||||
// The wake word's shape: the person goes straight on, and for eight seconds the voice
|
||||
// never dips far. It must not become "the room", nor end as "nothing said" at five.
|
||||
for (peak in listOf(0.035f, 0.05f, 0.1f)) {
|
||||
var start = emptyList<Float>()
|
||||
repeat(8) { start = start + steadyVoice(peak) }
|
||||
assertEndsAfter(start, listen(start, still(0.002f, 1)))
|
||||
assertEndsAfter(start, listen(start, still(0.004f, 1)))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aShortWordIsSpeech() {
|
||||
val start = still(0.001f, 10) + listOf(0.03f, 0.05f, 0.04f, 0.01f)
|
||||
assertEndsAfter(start, listen(start, still(0.001f, 1)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aClickIsNotSpeech() {
|
||||
assertEquals(Ended(Verdict.Nothing, EndOfSpeech.NOTHING_SAID_MS), listen(still(0.001f, 5) + listOf(0.3f), still(0.001f, 1)))
|
||||
val twice = still(0.001f, 5) + listOf(0.3f, 0.3f) + still(0.001f, 20) + listOf(0.3f, 0.3f)
|
||||
assertEquals(Ended(Verdict.Nothing, EndOfSpeech.NOTHING_SAID_MS), listen(twice, still(0.001f, 1)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aLongQuestionIsNotCutShort() {
|
||||
var start = still(0.001f, 5)
|
||||
repeat(10) { start = start + voice(0.06f) }
|
||||
assertEndsAfter(start, listen(start, still(0.001f, 1)))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun soundThatNeverPausesEndsAtTheLimit() {
|
||||
val ended = listen(emptyList(), listOf(0.01f, 0.2f, 0.01f, 0.2f, 0.2f, 0.2f, 0.01f))
|
||||
assertEquals(Ended(Verdict.Said, EndOfSpeech.LONGEST_MS), ended)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theSameWordsForAWhileEndIt() {
|
||||
// Music that never pauses, and the words stopped coming: that is the end.
|
||||
val ended = listen(still(0.001f, 5), listOf(0.01f, 0.2f, 0.01f, 0.2f, 0.2f, 0.2f, 0.01f)) { tick -> if (tick > 20) "play something" else "" }
|
||||
assertEquals(Verdict.Said, ended.verdict)
|
||||
assertTrue(ended.ms < 8_000)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun wordsInventedFromSilenceAreNotSpeech() {
|
||||
// A speech-to-text model handed silence writes "Thank you." -- in a silent room and in a
|
||||
// noisy one the microphone heard nothing above the room, so nothing was said.
|
||||
val invented = { tick: Int -> if (tick > 12) "Thank you." else "" }
|
||||
assertEquals(Ended(Verdict.Nothing, EndOfSpeech.NOTHING_SAID_MS), listen(emptyList(), still(0.001f, 1), invented))
|
||||
assertEquals(Ended(Verdict.Nothing, EndOfSpeech.NOTHING_SAID_MS), listen(emptyList(), noise(0.03f), invented))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aQuietVoiceCountsOnceItsWordsCome() {
|
||||
// Too soft to be sure of by loudness alone, but above the room, and the instance wrote words down.
|
||||
val start = still(0.001f, 5) + still(0.0035f, 20)
|
||||
assertEndsAfter(start, listen(start, still(0.001f, 1)) { tick -> if (tick > 15) "what time is it" else "" })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theFloorFollowsTheRoom() {
|
||||
val ear = EndOfSpeech()
|
||||
assertFalse(ear.heardSomething)
|
||||
repeat(30) { ear.tick(noise(0.03f)[it % 7]) }
|
||||
// Near the quietest of the noise, not at a fixed number.
|
||||
assertTrue(ear.floor > 0.02f && ear.floor < 0.03f)
|
||||
assertFalse(ear.heardSomething)
|
||||
assertFalse(ear.spoke)
|
||||
voice(0.12f).forEach { ear.tick(it) }
|
||||
assertTrue(ear.spoke)
|
||||
assertTrue(ear.heardSomething)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun thePhonesRecogniserIsWatched() {
|
||||
// It normally ends by itself; the watch is for one that does not.
|
||||
assertEquals(PhoneWatch.Wait, phoneWatch(3_000, anyWords = false, sameForMs = 3_000))
|
||||
assertEquals(PhoneWatch.GiveUp, phoneWatch(PHONE_NOTHING_SAID_MS, anyWords = false, sameForMs = PHONE_NOTHING_SAID_MS))
|
||||
// Words still coming: left alone.
|
||||
assertEquals(PhoneWatch.Wait, phoneWatch(20_000, anyWords = true, sameForMs = 400))
|
||||
// The same words for a while: asked to stop, then taken as they are.
|
||||
assertEquals(PhoneWatch.Finish, phoneWatch(20_000, anyWords = true, sameForMs = EndOfSpeech.SAME_WORDS_MS))
|
||||
assertEquals(PhoneWatch.Take, phoneWatch(20_000, anyWords = true, sameForMs = EndOfSpeech.SAME_WORDS_MS + PHONE_GRACE_MS))
|
||||
// And never past the limit.
|
||||
assertEquals(PhoneWatch.Finish, phoneWatch(EndOfSpeech.LONGEST_MS, anyWords = true, sameForMs = 0))
|
||||
assertEquals(PhoneWatch.Take, phoneWatch(EndOfSpeech.LONGEST_MS + PHONE_GRACE_MS, anyWords = true, sameForMs = 0))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aRecogniserThatShowsNoWordsWhileOneSpeaksIsNotGivenUpOn() {
|
||||
// No partial results, but it said speech began and its level is loud: somebody speaks.
|
||||
assertEquals(PhoneWatch.Wait, phoneWatch(12_000, anyWords = false, sameForMs = 12_000, silentForMs = 300))
|
||||
// Quiet for a good while after that: asked for what it has, then given up on.
|
||||
assertEquals(PhoneWatch.Finish, phoneWatch(20_000, anyWords = false, sameForMs = 20_000, silentForMs = PHONE_NOTHING_SAID_MS))
|
||||
assertEquals(PhoneWatch.GiveUp, phoneWatch(20_000, anyWords = false, sameForMs = 20_000, silentForMs = PHONE_NOTHING_SAID_MS + PHONE_GRACE_MS))
|
||||
// Words that stopped changing while the level is still loud: not cut off yet.
|
||||
assertEquals(PhoneWatch.Wait, phoneWatch(20_000, anyWords = true, sameForMs = EndOfSpeech.SAME_WORDS_MS, silentForMs = 200))
|
||||
}
|
||||
}
|
||||
@@ -375,6 +375,7 @@ object Fakes {
|
||||
wakeState = WakeState.Listening("OK Google"),
|
||||
notificationsBuild = true,
|
||||
navApps = listOf("google", "osmand"),
|
||||
assistantModels = models,
|
||||
)
|
||||
|
||||
/** The wake word in trouble, and its test having heard the phrase: what the rows say then. */
|
||||
|
||||
@@ -63,6 +63,7 @@ import eu.llembas.android.ui.scheduled.ScheduleContent
|
||||
import eu.llembas.android.ui.scheduled.ScheduleEditContent
|
||||
import eu.llembas.android.ui.scheduled.ScheduledContent
|
||||
import eu.llembas.android.ui.scheduled.SchedulingModelsContent
|
||||
import eu.llembas.android.ui.settings.AssistantModelChoices
|
||||
import eu.llembas.android.ui.settings.LanguageChoices
|
||||
import eu.llembas.android.ui.settings.NotificationSummaryGroup
|
||||
import eu.llembas.android.ui.settings.SettingsActions
|
||||
@@ -233,6 +234,14 @@ class ScreenShots {
|
||||
shoot("08-wake-sensitivity", Phone.Small, fontScale = 1.5f) { SheetOver { WakeChoices(WakeChoice.Sensitivity, Fakes.settings.prefs, onPick = {}) } }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun assistantModel() {
|
||||
// "Instance default" chosen, then one of the instance's models.
|
||||
shoot("08-assistant-model", Phone.Scroll) { SheetOver { AssistantModelChoices(Fakes.settings, onPick = {}) } }
|
||||
val picked = Fakes.settings.copy(prefs = Fakes.settings.prefs.copy(assistantModel = Fakes.models.last().id))
|
||||
shoot("08-assistant-model-chosen", Phone.Small, fontScale = 1.5f) { SheetOver { AssistantModelChoices(picked, onPick = {}) } }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun language() {
|
||||
shoot("17-language", Phone.Scroll) { SheetOver { LanguageChoices(Fakes.settings.prefs, onPick = {}) } }
|
||||
@@ -326,6 +335,16 @@ class ScreenShots {
|
||||
shoot("20-assistant-answered", content = over(Fakes.assistAnswered, false))
|
||||
shoot("21-assistant-writing", content = over(Fakes.assistWriting, false))
|
||||
shoot("22-assistant-locked", content = over(Fakes.assistOpened, true))
|
||||
// Over the lock screen after the wake word: listening, then the question waiting for the
|
||||
// unlock; and a conversation that was up when the phone locked is not shown.
|
||||
shoot("22-assistant-locked-listening", content = over(Fakes.assistListening, true))
|
||||
val waiting = Fakes.assistOpened.copy(waiting = "How far is it to the next town?")
|
||||
shoot("22-assistant-locked-waiting", content = over(waiting, true))
|
||||
shoot("22-assistant-locked-waiting", Phone.Small, fontScale = 1.5f, content = over(waiting, true))
|
||||
shoot("22-assistant-locked-answered", content = over(Fakes.assistAnswered, true))
|
||||
// Heard where the instance writes speech down: it waits as a recording, with no words.
|
||||
shoot("22-assistant-locked-recording", content = over(Fakes.assistOpened.copy(waitingRecording = true), true))
|
||||
shoot("22-assistant-locked-recording", Phone.Small, fontScale = 1.5f, content = over(Fakes.assistOpened.copy(waitingRecording = true), 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))
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"ref": "v2.0.0-beta.12",
|
||||
"commit": "dc2b9d3b55d021638c576732334214f07ee92ebe",
|
||||
"ref": "v2.0.0-beta.13",
|
||||
"commit": "3191ecf5fabb7583dd73826f54f7b37f6dae338c",
|
||||
"sha256": "fcdfaca53bec6edefc22ae0d600bf284c3fe3c8880ed959ae9db8d539fed5c31"
|
||||
}
|
||||
@@ -398,6 +398,9 @@ STRINGS: dict[str, str] = {
|
||||
"settings_assistant": "Assistant",
|
||||
"assistant_explained": "Make LLeMbas the phone's digital assistant: choose it under Default apps › Digital assistant app. Then holding the power button, the assist gesture or the lock screen's shortcut opens it over whatever is on screen.",
|
||||
"assistant_open_settings": "Open the assistant settings",
|
||||
"assistant_model": "Assistant model",
|
||||
"assistant_model_default": "Instance default",
|
||||
"assistant_model_default_line": "The model your new chats start on. Choose a quick one below if it is too slow for a spoken question.",
|
||||
"assistant_samsung": "On Samsung phones: Settings › Advanced features › Side button › Press and hold › Digital assistant.",
|
||||
"assistant_temporary": "Assistant chats are temporary",
|
||||
"assistant_read_aloud": "Read the answer aloud when asked by voice",
|
||||
@@ -448,12 +451,19 @@ STRINGS: dict[str, str] = {
|
||||
"assist_say_it": "Say it, then pause",
|
||||
"assist_type": "Type instead",
|
||||
"assist_writing_down": "Writing down what you said…",
|
||||
"assist_unlock_to_send": "Unlock to send",
|
||||
"assist_question_heard": "Question heard",
|
||||
"assist_recording_waits_line": "The phone is locked. Your question waits on this phone as a recording; nothing has been sent. Unlocking sends it to your instance to be written down and answered.",
|
||||
"assist_locked_line": "The phone is locked. Nothing is sent, and no answer is shown, until you unlock it.",
|
||||
"assist_conversation": "In conversation",
|
||||
"assist_conversation_line": "I listen again after each answer. Say “stop” to end.",
|
||||
"assist_conversation_end": "End",
|
||||
"assist_stop_words": "stop|that's all|that is all|that's it|goodbye|bye|enough|end|thank you that's all|cancel",
|
||||
"assistant_conversation": "Keep a spoken conversation going",
|
||||
"assistant_conversation_line": "After a spoken answer is read aloud, the assistant listens again — until you say “stop”, tap End, or say nothing for a few seconds. Works with a headset.",
|
||||
"experimental": "Experimental",
|
||||
"wake_experimental_line": "New, and tried on few phones so far. It may miss the phrase, start by mistake, or hear you and still not open the assistant.",
|
||||
"assistant_voice_experimental_line": "Experimental: listening by itself when the assistant opens, noticing when you have finished speaking, and the spoken conversation are new and do not work well on every phone yet. Typing a question and the microphone button always work.",
|
||||
"assist_wake_word_hint": "No wake word unless you want one: Settings › Assistant › Wake word turns on LLeMbas's own, on this phone.",
|
||||
"channel_wake": "Wake word",
|
||||
"wake_word": "Wake word",
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
"assist_conversation_line": "Po každé odpovědi znovu poslouchám. Řekněte „stop“ a skončíme.",
|
||||
"assist_help": "Podržením tlačítka napájení otevřete asistenta nad libovolnou aplikací; nebo použijte dlaždici v Rychlém nastavení.",
|
||||
"assist_hint": "Zeptejte se na cokoli",
|
||||
"assist_locked_line": "Telefon je zamčený. Dokud ho neodemknete, nic se neodešle a žádná odpověď se nezobrazí.",
|
||||
"assist_no_model": "Žádný model",
|
||||
"assist_notifications": "Shrnout má oznámení",
|
||||
"assist_notifications_phrases": "moje oznámení|má oznámení|mých oznámení|moje notifikace",
|
||||
@@ -49,6 +50,7 @@
|
||||
"assist_offline": "%1$s není dostupná",
|
||||
"assist_open_app": "Otevřít aplikaci",
|
||||
"assist_open_in_app": "Pokračovat v aplikaci",
|
||||
"assist_question_heard": "Otázka zaznamenána",
|
||||
"assist_quick_explain": "Vysvětlit",
|
||||
"assist_quick_explain_prompt": "Vysvětli, co je na mé obrazovce.",
|
||||
"assist_quick_summarise": "Shrnout",
|
||||
@@ -57,6 +59,7 @@
|
||||
"assist_quick_translate_prompt": "Přelož, co je na mé obrazovce, do češtiny.",
|
||||
"assist_read_aloud": "Přečíst nahlas",
|
||||
"assist_recogniser_failed": "Rozpoznávání řeči v telefonu se zastavilo. Zkuste to znovu nebo zvolte LLeMbas v Nastavení › Hlasový vstup.",
|
||||
"assist_recording_waits_line": "Telefon je zamčený. Vaše otázka čeká v tomto telefonu jako nahrávka; nic se neodeslalo. Po odemknutí se odešle vaší instanci, která ji přepíše a odpoví.",
|
||||
"assist_say_it": "Řekněte to a odmlčte se",
|
||||
"assist_screen_both": "S vaší další otázkou půjde text obrazovky a snímek obrazovky.",
|
||||
"assist_screen_shot": "S vaší další otázkou půjde snímek obrazovky.",
|
||||
@@ -66,6 +69,7 @@
|
||||
"assist_stop_reading": "Přestat číst",
|
||||
"assist_stop_words": "stop|dost|to je vše|to je všechno|konec|nashledanou|díky to je vše|zrušit|stop stop",
|
||||
"assist_type": "Raději psát",
|
||||
"assist_unlock_to_send": "Odemknout a odeslat",
|
||||
"assist_use_screen": "Použít obrazovku",
|
||||
"assist_voice_reply_off": "Hlasová odpověď je vypnutá",
|
||||
"assist_voice_reply_on": "Hlasová odpověď je zapnutá",
|
||||
@@ -75,10 +79,14 @@
|
||||
"assistant_conversation_line": "Po přečtení mluvené odpovědi asistent znovu poslouchá — dokud neřeknete „stop“, neklepnete na Ukončit nebo pár sekund nic neřeknete. Funguje i se sluchátky.",
|
||||
"assistant_explained": "Nastavte LLeMbas jako digitálního asistenta telefonu: zvolte ho v Výchozí aplikace › Digitální asistent. Podržení tlačítka napájení, gesto asistenta nebo zkratka na zamykací obrazovce ho pak otevře přes to, co je právě na obrazovce.",
|
||||
"assistant_listens": "Začít poslouchat, když se asistent otevře",
|
||||
"assistant_model": "Model asistenta",
|
||||
"assistant_model_default": "Výchozí model instance",
|
||||
"assistant_model_default_line": "Model, se kterým začínají vaše nové konverzace. Je-li na mluvenou otázku příliš pomalý, vyberte níže rychlejší.",
|
||||
"assistant_open_settings": "Otevřít nastavení asistenta",
|
||||
"assistant_read_aloud": "Přečíst odpověď nahlas, když se zeptáte hlasem",
|
||||
"assistant_samsung": "Na telefonech Samsung: Nastavení › Pokročilé funkce › Boční tlačítko › Stisknutí a podržení › Digitální asistent.",
|
||||
"assistant_temporary": "Konverzace s asistentem jsou dočasné",
|
||||
"assistant_voice_experimental_line": "Experimentální: samočinné poslouchání po otevření asistenta, rozpoznání, že jste domluvili, a mluvený rozhovor jsou nové a zatím nefungují dobře na každém telefonu. Napsat otázku a tlačítko mikrofonu fungují vždy.",
|
||||
"attach": "Přiložit soubor",
|
||||
"attach_choose_files": "Vybrat soubory",
|
||||
"attach_choose_photos": "Vybrat fotky",
|
||||
@@ -110,6 +118,7 @@
|
||||
"effort": "Úsilí",
|
||||
"empty_chat": "O čem si promluvíme?",
|
||||
"empty_chats": "Zatím žádné konverzace. Ne všichni, kdo bloudí, jsou ztraceni — založte jednu.",
|
||||
"experimental": "Experimentální",
|
||||
"instance_in_use": "Používá se",
|
||||
"kind_agent_line": "Pracuje na počítači, který jste propojili: čte, zapisuje a spouští příkazy ve složce.",
|
||||
"kind_chat_line": "Mluvte s modelem: otázky, psaní, soubory, které přiložíte.",
|
||||
@@ -309,6 +318,7 @@
|
||||
"wake_assistant_unbound_line": "Dokud ho nepřipojí, budicí slovo nemůže panel otevřít samo. Klepnutím otevřete systémové nastavení asistenta: vyberte jinou aplikaci a potom znovu LLeMbas, tím se připojí.",
|
||||
"wake_battery": "Nechat běžet na pozadí",
|
||||
"wake_battery_line": "Některé telefony (Samsung, Xiaomi, Huawei, OnePlus a další) kvůli baterii zastavují aplikace na pozadí, a s nimi i budicí slovo. Zde vyjměte LLeMbas z optimalizace baterie; dontkillmyapp.com vysvětluje nastavení vašeho telefonu.",
|
||||
"wake_experimental_line": "Novinka, zatím vyzkoušená jen na několika telefonech. Může frázi přeslechnout, spustit se omylem, nebo vás uslyšet a asistenta přesto neotevřít.",
|
||||
"wake_failed_engine": "Budicí slovo nefunguje: modul se nespustil",
|
||||
"wake_failed_line": "Neposlouchá. Zkusí to znovu samo.",
|
||||
"wake_failed_microphone": "Budicí slovo nefunguje: mikrofon se nespustil",
|
||||
@@ -424,6 +434,7 @@
|
||||
"assist_conversation_line": "Nach jeder Antwort höre ich wieder zu. Sag „Stopp“, um zu beenden.",
|
||||
"assist_help": "Halten Sie die Ein-/Aus-Taste, um den Assistenten über jeder App zu öffnen, oder nutzen Sie die Kachel in den Schnelleinstellungen.",
|
||||
"assist_hint": "Fragen Sie irgendetwas",
|
||||
"assist_locked_line": "Das Telefon ist gesperrt. Bis du es entsperrst, wird nichts gesendet und keine Antwort angezeigt.",
|
||||
"assist_no_model": "Kein Modell",
|
||||
"assist_notifications": "Meine Benachrichtigungen zusammenfassen",
|
||||
"assist_notifications_phrases": "meine benachrichtigungen|meinen benachrichtigungen|meiner benachrichtigungen",
|
||||
@@ -431,6 +442,7 @@
|
||||
"assist_offline": "%1$s ist nicht erreichbar",
|
||||
"assist_open_app": "App öffnen",
|
||||
"assist_open_in_app": "In der App fortsetzen",
|
||||
"assist_question_heard": "Frage aufgenommen",
|
||||
"assist_quick_explain": "Erklären",
|
||||
"assist_quick_explain_prompt": "Erkläre, was auf meinem Bildschirm ist.",
|
||||
"assist_quick_summarise": "Zusammenfassen",
|
||||
@@ -439,6 +451,7 @@
|
||||
"assist_quick_translate_prompt": "Übersetze, was auf meinem Bildschirm ist, ins Deutsche.",
|
||||
"assist_read_aloud": "Vorlesen",
|
||||
"assist_recogniser_failed": "Die Spracherkennung des Telefons hat angehalten. Versuchen Sie es erneut oder wählen Sie LLeMbas unter Einstellungen › Spracheingabe.",
|
||||
"assist_recording_waits_line": "Das Telefon ist gesperrt. Deine Frage wartet als Aufnahme auf diesem Telefon; es wurde nichts gesendet. Nach dem Entsperren geht sie an deine Instanz, die sie aufschreibt und beantwortet.",
|
||||
"assist_say_it": "Sprechen Sie, dann kurz Pause",
|
||||
"assist_screen_both": "Der Text des Bildschirms und ein Screenshot gehen mit Ihrer nächsten Frage mit.",
|
||||
"assist_screen_shot": "Ein Screenshot geht mit Ihrer nächsten Frage mit.",
|
||||
@@ -448,6 +461,7 @@
|
||||
"assist_stop_reading": "Vorlesen beenden",
|
||||
"assist_stop_words": "stopp|stop|das wars|das war's|das ist alles|genug|ende|tschüss|auf wiedersehen|danke das wars|abbrechen",
|
||||
"assist_type": "Lieber tippen",
|
||||
"assist_unlock_to_send": "Entsperren und senden",
|
||||
"assist_use_screen": "Bildschirm verwenden",
|
||||
"assist_voice_reply_off": "Sprachantwort ist aus",
|
||||
"assist_voice_reply_on": "Sprachantwort ist an",
|
||||
@@ -457,10 +471,14 @@
|
||||
"assistant_conversation_line": "Nachdem eine gesprochene Antwort vorgelesen wurde, hört der Assistent wieder zu — bis du „Stopp“ sagst, auf Beenden tippst oder ein paar Sekunden nichts sagst. Funktioniert mit einem Headset.",
|
||||
"assistant_explained": "Machen Sie LLeMbas zum digitalen Assistenten des Telefons: Wählen Sie ihn unter Standard-Apps › Digitaler Assistent. Das Halten der Einschalttaste, die Assistenzgeste oder die Verknüpfung auf dem Sperrbildschirm öffnet ihn dann über allem, was gerade angezeigt wird.",
|
||||
"assistant_listens": "Beim Öffnen des Assistenten zuhören",
|
||||
"assistant_model": "Modell des Assistenten",
|
||||
"assistant_model_default": "Standard der Instanz",
|
||||
"assistant_model_default_line": "Das Modell, mit dem deine neuen Chats beginnen. Ist es für eine gesprochene Frage zu langsam, wähle unten ein schnelleres.",
|
||||
"assistant_open_settings": "Assistenten-Einstellungen öffnen",
|
||||
"assistant_read_aloud": "Antwort vorlesen, wenn per Sprache gefragt wurde",
|
||||
"assistant_samsung": "Auf Samsung-Telefonen: Einstellungen › Erweiterte Funktionen › Seitentaste › Gedrückt halten › Digitaler Assistent.",
|
||||
"assistant_temporary": "Assistenten-Chats sind temporär",
|
||||
"assistant_voice_experimental_line": "Experimentell: Das selbstständige Zuhören beim Öffnen des Assistenten, das Erkennen, wann du fertig gesprochen hast, und das gesprochene Gespräch sind neu und funktionieren noch nicht auf jedem Telefon gut. Eine Frage tippen und die Mikrofontaste funktionieren immer.",
|
||||
"attach": "Datei anhängen",
|
||||
"attach_choose_files": "Dateien auswählen",
|
||||
"attach_choose_photos": "Fotos auswählen",
|
||||
@@ -492,6 +510,7 @@
|
||||
"effort": "Aufwand",
|
||||
"empty_chat": "Worüber sprechen wir?",
|
||||
"empty_chats": "Noch keine Chats. Nicht jeder, der wandert, ist verloren — fangen Sie einen an.",
|
||||
"experimental": "Experimentell",
|
||||
"instance_in_use": "In Verwendung",
|
||||
"kind_agent_line": "Arbeitet auf einem verknüpften Computer: liest, schreibt und führt Befehle in einem Ordner aus.",
|
||||
"kind_chat_line": "Mit einem Modell sprechen: Fragen, Texte, Dateien, die Sie anhängen.",
|
||||
@@ -692,6 +711,7 @@
|
||||
"wake_assistant_unbound_line": "Solange das so ist, kann das Aktivierungswort das Blatt nicht selbst öffnen. Tippe für die Assistenten-Einstellung des Systems: Eine andere App und dann wieder LLeMbas zu wählen verbindet ihn.",
|
||||
"wake_battery": "Im Hintergrund laufen lassen",
|
||||
"wake_battery_line": "Manche Telefone (Samsung, Xiaomi, Huawei, OnePlus und andere) beenden Hintergrund-Apps, um Akku zu sparen, und damit auch das Aktivierungswort. Nimm LLeMbas hier von der Akku-Optimierung aus; dontkillmyapp.com erklärt die Einstellungen deines Telefons.",
|
||||
"wake_experimental_line": "Neu und bisher nur auf wenigen Telefonen erprobt. Es kann den Satz überhören, versehentlich starten oder dich hören und den Assistenten trotzdem nicht öffnen.",
|
||||
"wake_failed_engine": "Aktivierungswort funktioniert nicht: Die Engine ist nicht gestartet",
|
||||
"wake_failed_line": "Es hört nicht zu. Es versucht es von selbst erneut.",
|
||||
"wake_failed_microphone": "Aktivierungswort funktioniert nicht: Das Mikrofon ist nicht gestartet",
|
||||
@@ -807,6 +827,7 @@
|
||||
"assist_conversation_line": "Vuelvo a escuchar después de cada respuesta. Di «para» para terminar.",
|
||||
"assist_help": "Mantenga pulsado el botón de encendido para abrir el asistente sobre cualquier app, o use el mosaico de Ajustes rápidos.",
|
||||
"assist_hint": "Pregunte lo que quiera",
|
||||
"assist_locked_line": "El teléfono está bloqueado. Hasta que lo desbloquees no se envía nada ni se muestra ninguna respuesta.",
|
||||
"assist_no_model": "Sin modelo",
|
||||
"assist_notifications": "Resumir mis notificaciones",
|
||||
"assist_notifications_phrases": "mis notificaciones",
|
||||
@@ -814,6 +835,7 @@
|
||||
"assist_offline": "No se puede contactar con %1$s",
|
||||
"assist_open_app": "Abrir la aplicación",
|
||||
"assist_open_in_app": "Continuar en la aplicación",
|
||||
"assist_question_heard": "Pregunta oída",
|
||||
"assist_quick_explain": "Explicar",
|
||||
"assist_quick_explain_prompt": "Explica lo que hay en mi pantalla.",
|
||||
"assist_quick_summarise": "Resumir",
|
||||
@@ -822,6 +844,7 @@
|
||||
"assist_quick_translate_prompt": "Traduce al español lo que hay en mi pantalla.",
|
||||
"assist_read_aloud": "Leer en voz alta",
|
||||
"assist_recogniser_failed": "El reconocimiento de voz del teléfono se detuvo. Inténtelo de nuevo o elija LLeMbas en Ajustes › Entrada de voz.",
|
||||
"assist_recording_waits_line": "El teléfono está bloqueado. Tu pregunta espera en este teléfono como grabación; no se ha enviado nada. Al desbloquear se envía a tu instancia para transcribirla y responderla.",
|
||||
"assist_say_it": "Dígalo y haga una pausa",
|
||||
"assist_screen_both": "El texto de la pantalla y una captura irán con su próxima pregunta.",
|
||||
"assist_screen_shot": "Una captura de pantalla irá con su próxima pregunta.",
|
||||
@@ -831,6 +854,7 @@
|
||||
"assist_stop_reading": "Dejar de leer",
|
||||
"assist_stop_words": "para|stop|basta|eso es todo|ya está|adiós|terminar|fin|gracias eso es todo|cancelar",
|
||||
"assist_type": "Escribir en su lugar",
|
||||
"assist_unlock_to_send": "Desbloquear para enviar",
|
||||
"assist_use_screen": "Usar la pantalla",
|
||||
"assist_voice_reply_off": "Respuesta por voz desactivada",
|
||||
"assist_voice_reply_on": "Respuesta por voz activada",
|
||||
@@ -840,10 +864,14 @@
|
||||
"assistant_conversation_line": "Después de leer en voz alta una respuesta hablada, el asistente vuelve a escuchar, hasta que digas «para», toques Terminar o no digas nada durante unos segundos. Funciona con auriculares.",
|
||||
"assistant_explained": "Convierta LLeMbas en el asistente digital del teléfono: elíjalo en Aplicaciones predeterminadas › App de asistencia digital. Mantener pulsado el botón de encendido, el gesto de asistencia o el acceso directo de la pantalla de bloqueo lo abrirá entonces sobre lo que haya en pantalla.",
|
||||
"assistant_listens": "Empezar a escuchar al abrir el asistente",
|
||||
"assistant_model": "Modelo del asistente",
|
||||
"assistant_model_default": "Predeterminado de la instancia",
|
||||
"assistant_model_default_line": "El modelo con el que empiezan tus chats nuevos. Si es demasiado lento para una pregunta hablada, elige abajo uno más rápido.",
|
||||
"assistant_open_settings": "Abrir los ajustes del asistente",
|
||||
"assistant_read_aloud": "Leer la respuesta en voz alta cuando se pregunte por voz",
|
||||
"assistant_samsung": "En los teléfonos Samsung: Ajustes › Funciones avanzadas › Botón lateral › Mantener pulsado › Asistente digital.",
|
||||
"assistant_temporary": "Los chats del asistente son temporales",
|
||||
"assistant_voice_experimental_line": "Experimental: escuchar por sí solo al abrir el asistente, notar cuándo has terminado de hablar y la conversación hablada son nuevos y todavía no funcionan bien en todos los teléfonos. Escribir una pregunta y el botón del micrófono funcionan siempre.",
|
||||
"attach": "Adjuntar un archivo",
|
||||
"attach_choose_files": "Elegir archivos",
|
||||
"attach_choose_photos": "Elegir fotos",
|
||||
@@ -875,6 +903,7 @@
|
||||
"effort": "Esfuerzo",
|
||||
"empty_chat": "¿De qué hablamos?",
|
||||
"empty_chats": "Aún no hay chats. No todos los que vagan están perdidos — empiece uno.",
|
||||
"experimental": "Experimental",
|
||||
"instance_in_use": "En uso",
|
||||
"kind_agent_line": "Trabaja en un ordenador que haya vinculado: lee, escribe y ejecuta comandos en una carpeta.",
|
||||
"kind_chat_line": "Hable con un modelo: preguntas, textos, los archivos que adjunte.",
|
||||
@@ -1074,6 +1103,7 @@
|
||||
"wake_assistant_unbound_line": "Hasta que lo conecte, la palabra de activación no puede abrir el panel por sí sola. Toca para ir al ajuste del asistente del sistema: elegir otra app y luego LLeMbas de nuevo lo conecta.",
|
||||
"wake_battery": "Dejar que funcione en segundo plano",
|
||||
"wake_battery_line": "Algunos teléfonos (Samsung, Xiaomi, Huawei, OnePlus y otros) detienen las apps en segundo plano para ahorrar batería, y con ellas la palabra de activación. Excluye aquí a LLeMbas de la optimización de batería; dontkillmyapp.com explica los ajustes de tu teléfono.",
|
||||
"wake_experimental_line": "Nuevo y probado por ahora en pocos teléfonos. Puede no oír la frase, activarse por error u oírte y aun así no abrir el asistente.",
|
||||
"wake_failed_engine": "La palabra de activación no funciona: el motor no se inició",
|
||||
"wake_failed_line": "No está escuchando. Lo intenta de nuevo por sí sola.",
|
||||
"wake_failed_microphone": "La palabra de activación no funciona: el micrófono no se inició",
|
||||
@@ -1189,6 +1219,7 @@
|
||||
"assist_conversation_line": "J’écoute à nouveau après chaque réponse. Dites « stop » pour arrêter.",
|
||||
"assist_help": "Maintenez le bouton marche/arrêt pour ouvrir l’assistant par-dessus n’importe quelle app, ou utilisez la tuile des Réglages rapides.",
|
||||
"assist_hint": "Demandez n'importe quoi",
|
||||
"assist_locked_line": "Le téléphone est verrouillé. Rien n’est envoyé et aucune réponse n’est affichée tant que vous ne l’avez pas déverrouillé.",
|
||||
"assist_no_model": "Aucun modèle",
|
||||
"assist_notifications": "Résumer mes notifications",
|
||||
"assist_notifications_phrases": "mes notifications",
|
||||
@@ -1196,6 +1227,7 @@
|
||||
"assist_offline": "%1$s est injoignable",
|
||||
"assist_open_app": "Ouvrir l'application",
|
||||
"assist_open_in_app": "Continuer dans l'application",
|
||||
"assist_question_heard": "Question entendue",
|
||||
"assist_quick_explain": "Expliquer",
|
||||
"assist_quick_explain_prompt": "Explique ce qui est sur mon écran.",
|
||||
"assist_quick_summarise": "Résumer",
|
||||
@@ -1204,6 +1236,7 @@
|
||||
"assist_quick_translate_prompt": "Traduis en français ce qui est sur mon écran.",
|
||||
"assist_read_aloud": "Lire à voix haute",
|
||||
"assist_recogniser_failed": "La reconnaissance vocale du téléphone s’est arrêtée. Réessayez, ou choisissez LLeMbas dans Réglages › Saisie vocale.",
|
||||
"assist_recording_waits_line": "Le téléphone est verrouillé. Votre question attend sur ce téléphone sous forme d’enregistrement ; rien n’a été envoyé. Au déverrouillage, elle est envoyée à votre instance pour être transcrite et recevoir une réponse.",
|
||||
"assist_say_it": "Dites-le, puis marquez une pause",
|
||||
"assist_screen_both": "Le texte de l’écran et une capture accompagneront votre prochaine question.",
|
||||
"assist_screen_shot": "Une capture d’écran accompagnera votre prochaine question.",
|
||||
@@ -1213,6 +1246,7 @@
|
||||
"assist_stop_reading": "Arrêter la lecture",
|
||||
"assist_stop_words": "stop|arrête|c'est tout|ça suffit|au revoir|fin|terminé|merci c'est tout|annuler",
|
||||
"assist_type": "Taper plutôt",
|
||||
"assist_unlock_to_send": "Déverrouiller pour envoyer",
|
||||
"assist_use_screen": "Utiliser l’écran",
|
||||
"assist_voice_reply_off": "Réponse vocale désactivée",
|
||||
"assist_voice_reply_on": "Réponse vocale activée",
|
||||
@@ -1222,10 +1256,14 @@
|
||||
"assistant_conversation_line": "Après la lecture d’une réponse orale, l’assistant écoute à nouveau — jusqu’à ce que vous disiez « stop », touchiez Terminer ou ne disiez rien pendant quelques secondes. Fonctionne avec un casque.",
|
||||
"assistant_explained": "Faites de LLeMbas l'assistant numérique du téléphone : choisissez-le dans Applications par défaut › Application d'assistance numérique. Maintenir le bouton d'alimentation, le geste d'assistance ou le raccourci de l'écran de verrouillage l'ouvrira alors par-dessus ce qui est affiché.",
|
||||
"assistant_listens": "Écouter dès l’ouverture de l’assistant",
|
||||
"assistant_model": "Modèle de l’assistant",
|
||||
"assistant_model_default": "Modèle par défaut de l’instance",
|
||||
"assistant_model_default_line": "Le modèle avec lequel commencent vos nouvelles discussions. S’il est trop lent pour une question orale, choisissez-en un plus rapide ci-dessous.",
|
||||
"assistant_open_settings": "Ouvrir les paramètres de l'assistant",
|
||||
"assistant_read_aloud": "Lire la réponse à voix haute en cas de question orale",
|
||||
"assistant_samsung": "Sur les téléphones Samsung : Paramètres › Fonctions avancées › Bouton latéral › Maintenir enfoncé › Assistant numérique.",
|
||||
"assistant_temporary": "Les conversations de l'assistant sont temporaires",
|
||||
"assistant_voice_experimental_line": "Expérimental : l’écoute automatique à l’ouverture de l’assistant, la détection de la fin de votre phrase et la conversation orale sont nouvelles et ne fonctionnent pas encore bien sur tous les téléphones. Écrire une question et le bouton du micro fonctionnent toujours.",
|
||||
"attach": "Joindre un fichier",
|
||||
"attach_choose_files": "Choisir des fichiers",
|
||||
"attach_choose_photos": "Choisir des photos",
|
||||
@@ -1257,6 +1295,7 @@
|
||||
"effort": "Effort",
|
||||
"empty_chat": "De quoi allons-nous parler ?",
|
||||
"empty_chats": "Pas encore de conversation. Tous ceux qui errent ne sont pas perdus — commencez-en une.",
|
||||
"experimental": "Expérimental",
|
||||
"instance_in_use": "Utilisée",
|
||||
"kind_agent_line": "Travaille sur un ordinateur que vous avez lié : lit, écrit et lance des commandes dans un dossier.",
|
||||
"kind_chat_line": "Parlez avec un modèle : questions, rédaction, les fichiers que vous joignez.",
|
||||
@@ -1457,6 +1496,7 @@
|
||||
"wake_assistant_unbound_line": "Tant que ce n’est pas fait, le mot d’activation ne peut pas ouvrir le panneau de lui-même. Touchez pour le réglage de l’assistant du système : choisir une autre app puis de nouveau LLeMbas le reconnecte.",
|
||||
"wake_battery": "Le laisser tourner en arrière-plan",
|
||||
"wake_battery_line": "Certains téléphones (Samsung, Xiaomi, Huawei, OnePlus et d’autres) arrêtent les apps en arrière-plan pour économiser la batterie, et le mot d’activation avec. Exemptez ici LLeMbas de l’optimisation de la batterie ; dontkillmyapp.com explique les réglages de votre téléphone.",
|
||||
"wake_experimental_line": "Nouveau, et essayé sur peu de téléphones pour l’instant. Il peut ne pas entendre la phrase, se déclencher par erreur, ou vous entendre sans pour autant ouvrir l’assistant.",
|
||||
"wake_failed_engine": "Le mot d’activation ne fonctionne pas : le moteur n’a pas démarré",
|
||||
"wake_failed_line": "Il n’écoute pas. Il réessaie de lui-même.",
|
||||
"wake_failed_microphone": "Le mot d’activation ne fonctionne pas : le micro n’a pas démarré",
|
||||
@@ -1572,6 +1612,7 @@
|
||||
"assist_conversation_line": "Minden válasz után újra figyelek. A befejezéshez mondd: „állj”.",
|
||||
"assist_help": "Tartsa lenyomva a bekapcsológombot, hogy bármely alkalmazás fölött megnyissa az asszisztenst, vagy használja a Gyorsbeállítások csempét.",
|
||||
"assist_hint": "Kérdezzen bármit",
|
||||
"assist_locked_line": "A telefon zárolva van. Amíg fel nem oldod, semmi sem megy el, és válasz sem jelenik meg.",
|
||||
"assist_no_model": "Nincs modell",
|
||||
"assist_notifications": "Értesítéseim összefoglalása",
|
||||
"assist_notifications_phrases": "értesítéseim|értesítéseimet|az értesítéseimről",
|
||||
@@ -1579,6 +1620,7 @@
|
||||
"assist_offline": "%1$s nem érhető el",
|
||||
"assist_open_app": "Alkalmazás megnyitása",
|
||||
"assist_open_in_app": "Folytatás az alkalmazásban",
|
||||
"assist_question_heard": "Kérdés rögzítve",
|
||||
"assist_quick_explain": "Magyarázat",
|
||||
"assist_quick_explain_prompt": "Magyarázd el, mi van a képernyőmön.",
|
||||
"assist_quick_summarise": "Összefoglalás",
|
||||
@@ -1587,6 +1629,7 @@
|
||||
"assist_quick_translate_prompt": "Fordítsd le magyarra, ami a képernyőmön van.",
|
||||
"assist_read_aloud": "Felolvasás",
|
||||
"assist_recogniser_failed": "A telefon beszédfelismerője leállt. Próbálja újra, vagy válassza a LLeMbast a Beállítások › Hangbevitel alatt.",
|
||||
"assist_recording_waits_line": "A telefon zárolva van. A kérdésed felvételként ezen a telefonon vár; semmi sem ment el. Feloldás után a példányodhoz kerül, amely leírja és megválaszolja.",
|
||||
"assist_say_it": "Mondja, aztán tartson szünetet",
|
||||
"assist_screen_both": "A képernyő szövege és egy képernyőkép a következő kérdésével megy.",
|
||||
"assist_screen_shot": "Egy képernyőkép a következő kérdésével megy.",
|
||||
@@ -1596,6 +1639,7 @@
|
||||
"assist_stop_reading": "Felolvasás leállítása",
|
||||
"assist_stop_words": "állj|stop|ennyi|ennyi volt|elég|vége|viszlát|köszönöm ennyi|mégse",
|
||||
"assist_type": "Inkább gépelés",
|
||||
"assist_unlock_to_send": "Feloldás és küldés",
|
||||
"assist_use_screen": "Képernyő használata",
|
||||
"assist_voice_reply_off": "A hangos válasz ki van kapcsolva",
|
||||
"assist_voice_reply_on": "A hangos válasz be van kapcsolva",
|
||||
@@ -1605,10 +1649,14 @@
|
||||
"assistant_conversation_line": "Egy szóbeli válasz felolvasása után az asszisztens újra figyel — amíg nem mondod, hogy „állj”, nem koppintasz a Befejezésre, vagy néhány másodpercig nem szólsz. Headsettel is működik.",
|
||||
"assistant_explained": "Tegye az LLeMbas-t a telefon digitális asszisztensévé: válassza ki az Alapértelmezett alkalmazások › Digitális asszisztens alkalmazás alatt. A bekapcsológomb lenyomva tartása, az asszisztens-gesztus vagy a lezárási képernyő parancsikonja ezután a képernyőn lévő tartalom felett nyitja meg.",
|
||||
"assistant_listens": "Hallgatás indítása az asszisztens megnyitásakor",
|
||||
"assistant_model": "Az asszisztens modellje",
|
||||
"assistant_model_default": "A példány alapértelmezése",
|
||||
"assistant_model_default_line": "Az a modell, amellyel az új csevegéseid indulnak. Ha egy kimondott kérdéshez túl lassú, válassz lent gyorsabbat.",
|
||||
"assistant_open_settings": "Asszisztens beállításainak megnyitása",
|
||||
"assistant_read_aloud": "Olvassa fel a választ, ha hangos kérdés érkezett",
|
||||
"assistant_samsung": "Samsung telefonokon: Beállítások › Speciális funkciók › Oldalgomb › Nyomva tartás › Digitális asszisztens.",
|
||||
"assistant_temporary": "Az asszisztenses csevegések ideiglenesek",
|
||||
"assistant_voice_experimental_line": "Kísérleti: az önálló hallgatás az asszisztens megnyitásakor, annak észlelése, hogy befejezted a beszédet, és a szóbeli beszélgetés új, és még nem minden telefonon működik jól. Kérdést beírni és a mikrofon gombot használni mindig lehet.",
|
||||
"attach": "Fájl csatolása",
|
||||
"attach_choose_files": "Fájlok kiválasztása",
|
||||
"attach_choose_photos": "Fényképek kiválasztása",
|
||||
@@ -1640,6 +1688,7 @@
|
||||
"effort": "Ráfordítás",
|
||||
"empty_chat": "Miről beszéljünk?",
|
||||
"empty_chats": "Még nincs csevegés. Nem mindenki van elveszve, aki bolyong — kezdjen el egyet.",
|
||||
"experimental": "Kísérleti",
|
||||
"instance_in_use": "Használatban",
|
||||
"kind_agent_line": "Egy összekapcsolt számítógépen dolgozik: olvas, ír és parancsokat futtat egy mappában.",
|
||||
"kind_chat_line": "Beszélgessen egy modellel: kérdések, írás, a csatolt fájlok.",
|
||||
@@ -1840,6 +1889,7 @@
|
||||
"wake_assistant_unbound_line": "Amíg nem csatlakoztatja, az ébresztőszó nem tudja magától megnyitni a panelt. Koppints a rendszer asszisztensbeállításához: ha másik alkalmazást, majd újra a LLeMbast választod, csatlakozik.",
|
||||
"wake_battery": "Futhasson a háttérben",
|
||||
"wake_battery_line": "Egyes telefonok (Samsung, Xiaomi, Huawei, OnePlus és mások) az akkumulátor kímélése miatt leállítják a háttéralkalmazásokat, és velük az ébresztőszót is. Itt vedd ki a LLeMbast az akkumulátor-optimalizálásból; a dontkillmyapp.com elmagyarázza a telefonod beállításait.",
|
||||
"wake_experimental_line": "Új, és eddig csak néhány telefonon próbáltuk ki. Előfordulhat, hogy nem hallja meg a kifejezést, tévedésből elindul, vagy meghall, és mégsem nyitja meg az asszisztenst.",
|
||||
"wake_failed_engine": "Az ébresztőszó nem működik: a motor nem indult el",
|
||||
"wake_failed_line": "Nem figyel. Magától újrapróbálja.",
|
||||
"wake_failed_microphone": "Az ébresztőszó nem működik: a mikrofon nem indult el",
|
||||
@@ -1955,6 +2005,7 @@
|
||||
"assist_conversation_line": "Ascolto di nuovo dopo ogni risposta. Di’ «basta» per finire.",
|
||||
"assist_help": "Tenga premuto il tasto di accensione per aprire l’assistente sopra qualsiasi app, oppure usi il riquadro delle Impostazioni rapide.",
|
||||
"assist_hint": "Chiedi qualsiasi cosa",
|
||||
"assist_locked_line": "Il telefono è bloccato. Finché non lo sblocchi non viene inviato nulla e non viene mostrata alcuna risposta.",
|
||||
"assist_no_model": "Nessun modello",
|
||||
"assist_notifications": "Riassumi le mie notifiche",
|
||||
"assist_notifications_phrases": "le mie notifiche|mie notifiche",
|
||||
@@ -1962,6 +2013,7 @@
|
||||
"assist_offline": "%1$s non è raggiungibile",
|
||||
"assist_open_app": "Apri l'app",
|
||||
"assist_open_in_app": "Continua nell'app",
|
||||
"assist_question_heard": "Domanda sentita",
|
||||
"assist_quick_explain": "Spiega",
|
||||
"assist_quick_explain_prompt": "Spiega cosa c’è sul mio schermo.",
|
||||
"assist_quick_summarise": "Riassumi",
|
||||
@@ -1970,6 +2022,7 @@
|
||||
"assist_quick_translate_prompt": "Traduci in italiano cosa c’è sul mio schermo.",
|
||||
"assist_read_aloud": "Leggi ad alta voce",
|
||||
"assist_recogniser_failed": "Il riconoscimento vocale del telefono si è fermato. Riprovi, oppure scelga LLeMbas in Impostazioni › Input vocale.",
|
||||
"assist_recording_waits_line": "Il telefono è bloccato. La tua domanda attende su questo telefono come registrazione; non è stato inviato nulla. Allo sblocco viene inviata alla tua istanza per essere trascritta e ricevere risposta.",
|
||||
"assist_say_it": "Lo dica, poi faccia una pausa",
|
||||
"assist_screen_both": "Il testo dello schermo e uno screenshot accompagnano la sua prossima domanda.",
|
||||
"assist_screen_shot": "Uno screenshot accompagna la sua prossima domanda.",
|
||||
@@ -1979,6 +2032,7 @@
|
||||
"assist_stop_reading": "Interrompi la lettura",
|
||||
"assist_stop_words": "basta|stop|è tutto|fine|ciao|arrivederci|grazie è tutto|annulla|smetti",
|
||||
"assist_type": "Scrivi invece",
|
||||
"assist_unlock_to_send": "Sblocca per inviare",
|
||||
"assist_use_screen": "Usa lo schermo",
|
||||
"assist_voice_reply_off": "Risposta vocale disattivata",
|
||||
"assist_voice_reply_on": "Risposta vocale attiva",
|
||||
@@ -1988,10 +2042,14 @@
|
||||
"assistant_conversation_line": "Dopo aver letto ad alta voce una risposta a voce, l’assistente ascolta di nuovo, finché non dici «basta», tocchi Termina o non dici nulla per qualche secondo. Funziona con le cuffie.",
|
||||
"assistant_explained": "Rendi LLeMbas l'assistente digitale del telefono: selezionalo in App predefinite › App di assistenza digitale. Tenendo premuto il tasto di accensione, il gesto di assistenza o la scorciatoia della schermata di blocco lo apre quindi sopra qualsiasi cosa sia a schermo.",
|
||||
"assistant_listens": "Inizia ad ascoltare all’apertura dell’assistente",
|
||||
"assistant_model": "Modello dell’assistente",
|
||||
"assistant_model_default": "Predefinito dell’istanza",
|
||||
"assistant_model_default_line": "Il modello con cui iniziano le tue nuove chat. Se è troppo lento per una domanda a voce, scegline sotto uno più rapido.",
|
||||
"assistant_open_settings": "Apri le impostazioni dell'assistente",
|
||||
"assistant_read_aloud": "Leggi la risposta ad alta voce quando la domanda è vocale",
|
||||
"assistant_samsung": "Sui telefoni Samsung: Impostazioni › Funzioni avanzate › Tasto laterale › Pressione prolungata › Assistente digitale.",
|
||||
"assistant_temporary": "Le chat dell'assistente sono temporanee",
|
||||
"assistant_voice_experimental_line": "Sperimentale: l’ascolto automatico all’apertura dell’assistente, il riconoscimento di quando hai finito di parlare e la conversazione a voce sono nuovi e non funzionano ancora bene su tutti i telefoni. Scrivere una domanda e il pulsante del microfono funzionano sempre.",
|
||||
"attach": "Allega un file",
|
||||
"attach_choose_files": "Scegli file",
|
||||
"attach_choose_photos": "Scegli foto",
|
||||
@@ -2023,6 +2081,7 @@
|
||||
"effort": "Impegno",
|
||||
"empty_chat": "Di cosa parliamo?",
|
||||
"empty_chats": "Ancora nessuna chat. Non tutti quelli che vagano sono perduti — iniziane una.",
|
||||
"experimental": "Sperimentale",
|
||||
"instance_in_use": "In uso",
|
||||
"kind_agent_line": "Lavora su un computer che ha collegato: legge, scrive ed esegue comandi in una cartella.",
|
||||
"kind_chat_line": "Parli con un modello: domande, scrittura, i file che allega.",
|
||||
@@ -2222,6 +2281,7 @@
|
||||
"wake_assistant_unbound_line": "Finché non lo collega, la parola di attivazione non può aprire il pannello da sola. Tocca per l’impostazione dell’assistente di sistema: scegliere un’altra app e poi di nuovo LLeMbas lo collega.",
|
||||
"wake_battery": "Lascialo funzionare in background",
|
||||
"wake_battery_line": "Alcuni telefoni (Samsung, Xiaomi, Huawei, OnePlus e altri) fermano le app in background per risparmiare batteria, e con loro la parola di attivazione. Escludi qui LLeMbas dall’ottimizzazione della batteria; dontkillmyapp.com spiega le impostazioni del tuo telefono.",
|
||||
"wake_experimental_line": "Nuovo e provato finora su pochi telefoni. Può non sentire la frase, attivarsi per errore, oppure sentirti e non aprire comunque l’assistente.",
|
||||
"wake_failed_engine": "La parola di attivazione non funziona: il motore non si è avviato",
|
||||
"wake_failed_line": "Non è in ascolto. Riprova da sola.",
|
||||
"wake_failed_microphone": "La parola di attivazione non funziona: il microfono non si è avviato",
|
||||
@@ -2337,6 +2397,7 @@
|
||||
"assist_conversation_line": "Po każdej odpowiedzi słucham znowu. Powiedz „stop”, aby zakończyć.",
|
||||
"assist_help": "Przytrzymaj przycisk zasilania, aby otworzyć asystenta nad dowolną aplikacją, albo użyj kafelka w Szybkich ustawieniach.",
|
||||
"assist_hint": "Zapytaj o cokolwiek",
|
||||
"assist_locked_line": "Telefon jest zablokowany. Dopóki go nie odblokujesz, nic nie zostanie wysłane ani żadna odpowiedź nie zostanie pokazana.",
|
||||
"assist_no_model": "Brak modelu",
|
||||
"assist_notifications": "Podsumuj moje powiadomienia",
|
||||
"assist_notifications_phrases": "moje powiadomienia|moich powiadomień|moje notyfikacje",
|
||||
@@ -2344,6 +2405,7 @@
|
||||
"assist_offline": "%1$s jest nieosiągalna",
|
||||
"assist_open_app": "Otwórz aplikację",
|
||||
"assist_open_in_app": "Kontynuuj w aplikacji",
|
||||
"assist_question_heard": "Pytanie usłyszane",
|
||||
"assist_quick_explain": "Wyjaśnij",
|
||||
"assist_quick_explain_prompt": "Wyjaśnij, co jest na moim ekranie.",
|
||||
"assist_quick_summarise": "Podsumuj",
|
||||
@@ -2352,6 +2414,7 @@
|
||||
"assist_quick_translate_prompt": "Przetłumacz na polski to, co jest na moim ekranie.",
|
||||
"assist_read_aloud": "Przeczytaj na głos",
|
||||
"assist_recogniser_failed": "Rozpoznawanie mowy w telefonie przestało działać. Spróbuj ponownie albo wybierz LLeMbas w Ustawienia › Wprowadzanie głosowe.",
|
||||
"assist_recording_waits_line": "Telefon jest zablokowany. Twoje pytanie czeka w tym telefonie jako nagranie; nic nie zostało wysłane. Po odblokowaniu trafi do Twojej instancji, która je zapisze i na nie odpowie.",
|
||||
"assist_say_it": "Powiedz to i zrób pauzę",
|
||||
"assist_screen_both": "Tekst z ekranu i zrzut ekranu zostaną wysłane z następnym pytaniem.",
|
||||
"assist_screen_shot": "Zrzut ekranu zostanie wysłany z następnym pytaniem.",
|
||||
@@ -2361,6 +2424,7 @@
|
||||
"assist_stop_reading": "Przestań czytać",
|
||||
"assist_stop_words": "stop|wystarczy|to wszystko|koniec|do widzenia|dzięki to wszystko|anuluj|przestań",
|
||||
"assist_type": "Zamiast tego pisz",
|
||||
"assist_unlock_to_send": "Odblokuj, aby wysłać",
|
||||
"assist_use_screen": "Użyj ekranu",
|
||||
"assist_voice_reply_off": "Odpowiedź głosowa wyłączona",
|
||||
"assist_voice_reply_on": "Odpowiedź głosowa włączona",
|
||||
@@ -2370,10 +2434,14 @@
|
||||
"assistant_conversation_line": "Po odczytaniu odpowiedzi na głos asystent znów słucha — dopóki nie powiesz „stop”, nie dotkniesz Zakończ albo nie będziesz milczeć przez kilka sekund. Działa ze słuchawkami.",
|
||||
"assistant_explained": "Ustaw LLeMbas jako cyfrowego asystenta telefonu: wybierz go w Domyślne aplikacje › Aplikacja asystenta cyfrowego. Przytrzymanie przycisku zasilania, gest asystenta lub skrót z ekranu blokady otwiera go wtedy nad tym, co jest na ekranie.",
|
||||
"assistant_listens": "Zacznij słuchać po otwarciu asystenta",
|
||||
"assistant_model": "Model asystenta",
|
||||
"assistant_model_default": "Domyślny model instancji",
|
||||
"assistant_model_default_line": "Model, od którego zaczynają się Twoje nowe czaty. Jeśli jest za wolny na pytanie zadane głosem, wybierz poniżej szybszy.",
|
||||
"assistant_open_settings": "Otwórz ustawienia asystenta",
|
||||
"assistant_read_aloud": "Odczytaj odpowiedź na głos, gdy pytanie było głosowe",
|
||||
"assistant_samsung": "W telefonach Samsung: Ustawienia › Funkcje zaawansowane › Przycisk boczny › Naciśnięcie i przytrzymanie › Asystent cyfrowy.",
|
||||
"assistant_temporary": "Czaty asystenta są tymczasowe",
|
||||
"assistant_voice_experimental_line": "Eksperymentalne: samoczynne słuchanie po otwarciu asystenta, rozpoznawanie, że skończyłeś mówić, oraz rozmowa głosowa są nowe i nie na każdym telefonie działają jeszcze dobrze. Wpisanie pytania i przycisk mikrofonu działają zawsze.",
|
||||
"attach": "Załącz plik",
|
||||
"attach_choose_files": "Wybierz pliki",
|
||||
"attach_choose_photos": "Wybierz zdjęcia",
|
||||
@@ -2405,6 +2473,7 @@
|
||||
"effort": "Wysiłek",
|
||||
"empty_chat": "O czym porozmawiamy?",
|
||||
"empty_chats": "Nie ma jeszcze czatów. Nie każdy, kto błądzi, jest zgubiony — zacznij jeden.",
|
||||
"experimental": "Eksperymentalne",
|
||||
"instance_in_use": "W użyciu",
|
||||
"kind_agent_line": "Pracuje na połączonym komputerze: czyta, zapisuje i uruchamia polecenia w folderze.",
|
||||
"kind_chat_line": "Rozmawiaj z modelem: pytania, pisanie, pliki, które dołączysz.",
|
||||
@@ -2604,6 +2673,7 @@
|
||||
"wake_assistant_unbound_line": "Dopóki go nie połączy, słowo aktywujące nie może samo otworzyć panelu. Dotknij, aby przejść do systemowego ustawienia asystenta: wybranie innej aplikacji, a potem znów LLeMbas, połączy go.",
|
||||
"wake_battery": "Pozwól działać w tle",
|
||||
"wake_battery_line": "Niektóre telefony (Samsung, Xiaomi, Huawei, OnePlus i inne) zatrzymują aplikacje w tle, by oszczędzać baterię, a z nimi słowo aktywujące. Wyłącz tu LLeMbas z optymalizacji baterii; dontkillmyapp.com wyjaśnia ustawienia Twojego telefonu.",
|
||||
"wake_experimental_line": "Nowość, sprawdzona na razie na niewielu telefonach. Może nie usłyszeć frazy, uruchomić się przez pomyłkę albo usłyszeć Cię i mimo to nie otworzyć asystenta.",
|
||||
"wake_failed_engine": "Słowo aktywujące nie działa: silnik się nie uruchomił",
|
||||
"wake_failed_line": "Nie nasłuchuje. Spróbuje ponownie samo.",
|
||||
"wake_failed_microphone": "Słowo aktywujące nie działa: mikrofon się nie uruchomił",
|
||||
@@ -2719,6 +2789,7 @@
|
||||
"assist_conversation_line": "Po každej odpovedi znova počúvam. Povedzte „stop“ a skončíme.",
|
||||
"assist_help": "Podržaním tlačidla napájania otvoríte asistenta nad ľubovoľnou aplikáciou; alebo použite dlaždicu v Rýchlych nastaveniach.",
|
||||
"assist_hint": "Spýtajte sa na čokoľvek",
|
||||
"assist_locked_line": "Telefón je zamknutý. Kým ho neodomknete, nič sa neodošle a žiadna odpoveď sa nezobrazí.",
|
||||
"assist_no_model": "Žiadny model",
|
||||
"assist_notifications": "Zhrnúť moje oznámenia",
|
||||
"assist_notifications_phrases": "moje oznámenia|mojich oznámení|moje notifikácie",
|
||||
@@ -2726,6 +2797,7 @@
|
||||
"assist_offline": "%1$s je nedostupná",
|
||||
"assist_open_app": "Otvoriť aplikáciu",
|
||||
"assist_open_in_app": "Pokračovať v aplikácii",
|
||||
"assist_question_heard": "Otázka zaznamenaná",
|
||||
"assist_quick_explain": "Vysvetliť",
|
||||
"assist_quick_explain_prompt": "Vysvetli, čo je na mojej obrazovke.",
|
||||
"assist_quick_summarise": "Zhrnúť",
|
||||
@@ -2734,6 +2806,7 @@
|
||||
"assist_quick_translate_prompt": "Prelož do slovenčiny, čo je na mojej obrazovke.",
|
||||
"assist_read_aloud": "Prečítať nahlas",
|
||||
"assist_recogniser_failed": "Rozpoznávanie reči v telefóne sa zastavilo. Skúste to znova alebo zvoľte LLeMbas v Nastaveniach › Hlasový vstup.",
|
||||
"assist_recording_waits_line": "Telefón je zamknutý. Vaša otázka čaká v tomto telefóne ako nahrávka; nič sa neodoslalo. Po odomknutí sa odošle vašej inštancii, ktorá ju prepíše a odpovie.",
|
||||
"assist_say_it": "Povedzte to a odmlčte sa",
|
||||
"assist_screen_both": "S vašou ďalšou otázkou pôjde text obrazovky a snímka obrazovky.",
|
||||
"assist_screen_shot": "S vašou ďalšou otázkou pôjde snímka obrazovky.",
|
||||
@@ -2743,6 +2816,7 @@
|
||||
"assist_stop_reading": "Prestať čítať",
|
||||
"assist_stop_words": "stop|dosť|to je všetko|koniec|dovidenia|ďakujem to je všetko|zrušiť|prestaň",
|
||||
"assist_type": "Radšej písať",
|
||||
"assist_unlock_to_send": "Odomknúť a odoslať",
|
||||
"assist_use_screen": "Použiť obrazovku",
|
||||
"assist_voice_reply_off": "Hlasová odpoveď je vypnutá",
|
||||
"assist_voice_reply_on": "Hlasová odpoveď je zapnutá",
|
||||
@@ -2752,10 +2826,14 @@
|
||||
"assistant_conversation_line": "Po prečítaní hovorenej odpovede asistent znova počúva — kým nepoviete „stop“, neťuknete na Ukončiť alebo pár sekúnd nič nepoviete. Funguje aj so slúchadlami.",
|
||||
"assistant_explained": "Nastavte LLeMbas ako digitálneho asistenta telefónu: zvoľte ho v Predvolené aplikácie › Digitálny asistent. Podržanie tlačidla napájania, gesto asistenta alebo skratka na uzamknutej obrazovke ho potom otvorí nad tým, čo je práve na obrazovke.",
|
||||
"assistant_listens": "Začať počúvať, keď sa asistent otvorí",
|
||||
"assistant_model": "Model asistenta",
|
||||
"assistant_model_default": "Predvolený model inštancie",
|
||||
"assistant_model_default_line": "Model, s ktorým sa začínajú vaše nové konverzácie. Ak je na hovorenú otázku príliš pomalý, vyberte nižšie rýchlejší.",
|
||||
"assistant_open_settings": "Otvoriť nastavenia asistenta",
|
||||
"assistant_read_aloud": "Prečítať odpoveď nahlas, keď sa spýtate hlasom",
|
||||
"assistant_samsung": "Na telefónoch Samsung: Nastavenia › Rozšírené funkcie › Tlačidlo na boku › Stlačenie a podržanie › Digitálny asistent.",
|
||||
"assistant_temporary": "Konverzácie s asistentom sú dočasné",
|
||||
"assistant_voice_experimental_line": "Experimentálne: samočinné počúvanie po otvorení asistenta, rozpoznanie, že ste dohovorili, a hovorený rozhovor sú nové a zatiaľ nefungujú dobre na každom telefóne. Napísať otázku a tlačidlo mikrofónu fungujú vždy.",
|
||||
"attach": "Priložiť súbor",
|
||||
"attach_choose_files": "Vybrať súbory",
|
||||
"attach_choose_photos": "Vybrať fotky",
|
||||
@@ -2787,6 +2865,7 @@
|
||||
"effort": "Úsilie",
|
||||
"empty_chat": "O čom sa pozhovárame?",
|
||||
"empty_chats": "Zatiaľ žiadne konverzácie. Nie všetci, čo blúdia, sú stratení — začnite jednu.",
|
||||
"experimental": "Experimentálne",
|
||||
"instance_in_use": "Používa sa",
|
||||
"kind_agent_line": "Pracuje na počítači, ktorý ste prepojili: číta, zapisuje a spúšťa príkazy v priečinku.",
|
||||
"kind_chat_line": "Rozprávajte sa s modelom: otázky, písanie, súbory, ktoré priložíte.",
|
||||
@@ -2986,6 +3065,7 @@
|
||||
"wake_assistant_unbound_line": "Kým ho nepripojí, budiace slovo nemôže panel otvoriť samo. Ťuknutím otvoríte systémové nastavenie asistenta: vyberte inú aplikáciu a potom znova LLeMbas, tým sa pripojí.",
|
||||
"wake_battery": "Nechať bežať na pozadí",
|
||||
"wake_battery_line": "Niektoré telefóny (Samsung, Xiaomi, Huawei, OnePlus a ďalšie) kvôli batérii zastavujú aplikácie na pozadí, a s nimi aj budiace slovo. Tu vyjmite LLeMbas z optimalizácie batérie; dontkillmyapp.com vysvetľuje nastavenia vášho telefónu.",
|
||||
"wake_experimental_line": "Novinka, zatiaľ vyskúšaná len na niekoľkých telefónoch. Môže frázu prepočuť, spustiť sa omylom, alebo vás začuť a asistenta aj tak neotvoriť.",
|
||||
"wake_failed_engine": "Budiace slovo nefunguje: modul sa nespustil",
|
||||
"wake_failed_line": "Nepočúva. Skúsi to znova samo.",
|
||||
"wake_failed_microphone": "Budiace slovo nefunguje: mikrofón sa nespustil",
|
||||
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"tag": "v2.0.0-beta.12",
|
||||
"commit": "dc2b9d3b55d021638c576732334214f07ee92ebe",
|
||||
"sha256": "90d4a126a568524682cce6e65139efdf802a57f336b28f4630d781021552879e",
|
||||
"tag": "v2.0.0-beta.13",
|
||||
"commit": "3191ecf5fabb7583dd73826f54f7b37f6dae338c",
|
||||
"sha256": "75803136d7e5c2b2173639c6e219b2427c3314c0520bdb70c26f6b85dacaf9ba",
|
||||
"res": {
|
||||
"values": "8fc09c23657680c804b41580f6dfff794ff56794df921585abdfeb089432528f",
|
||||
"values-night": "342b1a2eecf5c7baddff407355ae2ae20c428a9970bba7db52e7d8bf1cb8c613"
|
||||
"values": "abbab21cbfec763d7f4dc40ef111ade8c6bff88aa59d0c1405ad0c2eb5c74076",
|
||||
"values-night": "91d16df6047a101e0526f6ee96e19a16b2ed80fe7ef3e2fd177b6f1e955434c1"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user