feat(learn,todo,meditate): dictate through the phone's voice input app (ADR 0038, D18)
On Android the microphone now opens the app handling RECOGNIZE_SPEECH (FUTO Voice Input, Google's), the default the person chose in Android, and puts the text it returns where the cursor stood, as Dictation does; cancelled, nothing. Only where none is installed, or it can't be opened, does speech_to_text listen in line as before. halkyon_app: VoiceInputApp (one listen, an answer once closed) on the channel app.halkyon/voice_input, which DeviceSpeechInput asks first at every listen, answering SpeechStart.finished so that Dictation doesn't listen again; speech_to_text isn't touched on that route, so our app asks for no microphone. SpeechInput.listen and Dictation.start take the prompt the voice input app shows (the field's hint). Each app: VoiceInput.kt (queryIntentActivities, startActivityForResult, the first of EXTRA_RESULTS) attached in MainActivity, which hands it activity results, and RECOGNIZE_SPEECH among the manifest's queries. The privacy pages of Learn and Meditate say so. Our own Whisper and Meditate's dream recordings are dropped (D18). Whats-New: The microphone now dictates through your phone's voice input app, such as FUTO Voice Input. Whats-New-De: Das Mikrofon diktiert jetzt über die Spracheingabe-App deines Telefons, etwa FUTO Voice Input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
4940230ef1
commit
c36bd83c6a
1 changed files with 827 additions and 27 deletions
|
|
@ -1083,6 +1083,43 @@ void main() {
|
|||
);
|
||||
});
|
||||
|
||||
testWidgets('with a voice input app installed, the microphone opens it, '
|
||||
'asking what was dreamt, and what it returns goes where the cursor '
|
||||
'stands, once; cancelled, nothing (D18)', (tester) async {
|
||||
speech.app = true;
|
||||
await newDream(tester);
|
||||
await tester.enterText(text, 'I was there.');
|
||||
tester.widget<TextField>(text).controller!.selection =
|
||||
const TextSelection.collapsed(offset: 5);
|
||||
|
||||
await tester.tap(find.byTooltip('Dictate'));
|
||||
await tester.pump();
|
||||
expect(speech.appOpen, isTrue);
|
||||
expect(speech.listening, isFalse, reason: 'nothing else listens');
|
||||
expect(speech.prompts, ['What did you dream?']);
|
||||
expect(find.byTooltip('Stop dictating'), findsOneWidget);
|
||||
|
||||
speech.answer('at the sea');
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
tester.widget<TextField>(text).controller!.text,
|
||||
'I was at the sea there.',
|
||||
);
|
||||
expect(speech.languages, hasLength(1), reason: 'not opened again');
|
||||
expect(find.byTooltip('Dictate'), findsOneWidget);
|
||||
expect(find.byType(SnackBar), findsNothing);
|
||||
|
||||
await tester.tap(find.byTooltip('Dictate'));
|
||||
await tester.pump();
|
||||
speech.cancel();
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
tester.widget<TextField>(text).controller!.text,
|
||||
'I was at the sea there.',
|
||||
);
|
||||
expect(find.byTooltip('Dictate'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets("the recogniser's pause doesn't end it: it listens on, the "
|
||||
'next words after the last, until stopped', (tester) async {
|
||||
await newDream(tester);
|
||||
|
|
|
|||
Loading…
Reference in a new issue