|
|
|
@@ -495,6 +495,13 @@ const ChatScreen: React.FC = () => {
|
|
|
|
|
const activity = (message.payload.activity as string) || 'idle';
|
|
|
|
|
const tool = (message.payload.tool as string) || '';
|
|
|
|
|
setAgentActivity({ activity, tool });
|
|
|
|
|
// Solange ARIA arbeitet (thinking/tool/responding) den Conversation-
|
|
|
|
|
// Focus halten — sonst spielt Spotify in der ~20s-Verarbeitungspause
|
|
|
|
|
// zwischen User-Aufnahme-Ende und TTS-Start wieder. Bei 'idle' wird
|
|
|
|
|
// der Focus nur dann released wenn auch kein TTS mehr aktiv ist.
|
|
|
|
|
if (activity !== 'idle') {
|
|
|
|
|
audioService.acquireConversationFocus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Voice-Config aus Diagnostic — setzt die lokale App-Stimme auf den
|
|
|
|
@@ -658,6 +665,10 @@ const ChatScreen: React.FC = () => {
|
|
|
|
|
});
|
|
|
|
|
const unsubTtsEnd = audioService.onPlaybackFinished(() => {
|
|
|
|
|
releaseBackgroundAudio('tts').catch(() => {});
|
|
|
|
|
// ARIAs Antwort komplett vorgelesen → Conversation-Focus freigeben damit
|
|
|
|
|
// Spotify wieder darf. Vorher (waehrend agentActivity != idle) hat das
|
|
|
|
|
// acquireConversationFocus den Focus durchgehend gehalten.
|
|
|
|
|
audioService.releaseConversationFocus();
|
|
|
|
|
// Vor naechster Aufnahme: barge-listening aus damit der AudioRecorder
|
|
|
|
|
// das Mikro greifen kann.
|
|
|
|
|
wakeWordService.stopBargeListening().catch(() => {});
|
|
|
|
@@ -807,6 +818,9 @@ const ChatScreen: React.FC = () => {
|
|
|
|
|
const cancelRequest = useCallback(() => {
|
|
|
|
|
setAgentActivity({ activity: 'idle', tool: '' });
|
|
|
|
|
rvs.send('cancel_request' as any, {});
|
|
|
|
|
// Conversation-Focus freigeben — es kommt keine TTS-Antwort mehr,
|
|
|
|
|
// sonst bliebe Spotify ewig pausiert.
|
|
|
|
|
audioService.releaseConversationFocus();
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
// Barge-In: wenn der User waehrend ARIA arbeitet/spricht eine neue Sprach-
|
|
|
|
|