fix(audio): rollback agentActivity-Conversation-Focus, Spotify pausiert NUR bei TTS
Der vorige Commit (acquireConversationFocus bei agentActivity != idle) war zu aggressiv — Spotify pausierte schon waehrend 'ARIA denkt/schreibt' und das zugehoerige release greift nicht zuverlaessig (Race mit nachfolgenden agent_activity-Events). Stefan: 'spotify resumet nicht mehr, hoert schon beim ARIA-denkt-Passus auf zu spielen'. Erwartetes Verhalten: - Aufnahme: AudioFocus → Spotify pausiert (~5s) - ARIA denkt/schreibt (~20s): kein Focus → Spotify spielt weiter - TTS: AudioFocus per requestDuck → Spotify pausiert - TTS-Ende: deferred release nach 800ms → Spotify resumed Underrun-Schutz im PcmStreamPlayer haelt Spotify durchgehend gepaust solange TTS rendert (auch in den GPU-Pausen zwischen Saetzen). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -495,13 +495,8 @@ const ChatScreen: React.FC = () => {
|
|||||||
const activity = (message.payload.activity as string) || 'idle';
|
const activity = (message.payload.activity as string) || 'idle';
|
||||||
const tool = (message.payload.tool as string) || '';
|
const tool = (message.payload.tool as string) || '';
|
||||||
setAgentActivity({ activity, tool });
|
setAgentActivity({ activity, tool });
|
||||||
// Solange ARIA arbeitet (thinking/tool/responding) den Conversation-
|
// Spotify darf waehrend "ARIA denkt/schreibt" weiterspielen — pausiert
|
||||||
// Focus halten — sonst spielt Spotify in der ~20s-Verarbeitungspause
|
// nur wenn TTS startet (dann acquired _firePlaybackStarted den Focus).
|
||||||
// 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
|
// Voice-Config aus Diagnostic — setzt die lokale App-Stimme auf den
|
||||||
@@ -665,10 +660,6 @@ const ChatScreen: React.FC = () => {
|
|||||||
});
|
});
|
||||||
const unsubTtsEnd = audioService.onPlaybackFinished(() => {
|
const unsubTtsEnd = audioService.onPlaybackFinished(() => {
|
||||||
releaseBackgroundAudio('tts').catch(() => {});
|
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
|
// Vor naechster Aufnahme: barge-listening aus damit der AudioRecorder
|
||||||
// das Mikro greifen kann.
|
// das Mikro greifen kann.
|
||||||
wakeWordService.stopBargeListening().catch(() => {});
|
wakeWordService.stopBargeListening().catch(() => {});
|
||||||
@@ -818,9 +809,6 @@ const ChatScreen: React.FC = () => {
|
|||||||
const cancelRequest = useCallback(() => {
|
const cancelRequest = useCallback(() => {
|
||||||
setAgentActivity({ activity: 'idle', tool: '' });
|
setAgentActivity({ activity: 'idle', tool: '' });
|
||||||
rvs.send('cancel_request' as any, {});
|
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-
|
// Barge-In: wenn der User waehrend ARIA arbeitet/spricht eine neue Sprach-
|
||||||
|
|||||||
Reference in New Issue
Block a user