debug: Logs fuer Auto-Playback-Bug — canPlay + silent-state sichtbar
Stefan berichtet dass Auto-Playback trotz Closure-Fix nicht greift. Zwei neue Log-Zeilen die beim naechsten Test direkt zeigen was schief laeuft: - ChatScreen: "[Chat] audio-msg canPlay=X (enabled=Y muted=Z)" - audio.ts: "[Audio] PCM-Stream start: silent=X messageId=Y ..." Ausreichend um zu unterscheiden: * canPlay=false trotz Mund-an → ttsMuted bleibt im State haengen * canPlay=true aber silent=true in audio.ts → Ref-Bug oder race * silent=false aber nichts hoerbar → native-module oder audio-routing Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1d34143be5
commit
9e12e0001c
|
|
@ -316,6 +316,10 @@ const ChatScreen: React.FC = () => {
|
|||
// TTS-Audio abspielen wenn vorhanden — respektiert geraetelokalen Mute/Disable
|
||||
// WICHTIG: via Ref statt direkt state lesen, sonst ist's stale (Closure-Bug).
|
||||
const canPlay = ttsCanPlayRef.current;
|
||||
if (message.type === 'audio_pcm' || (message.type === 'audio' && message.payload.base64)) {
|
||||
console.log('[Chat] audio-msg canPlay=%s (enabled=%s muted=%s)',
|
||||
canPlay, ttsDeviceEnabled, ttsMuted);
|
||||
}
|
||||
if (message.type === 'audio' && message.payload.base64) {
|
||||
const b64 = message.payload.base64 as string;
|
||||
const refId = (message.payload.messageId as string) || '';
|
||||
|
|
|
|||
|
|
@ -459,6 +459,13 @@ class AudioService {
|
|||
console.warn('[Audio] PcmStreamPlayer Native Module nicht verfuegbar');
|
||||
return '';
|
||||
}
|
||||
// Debug-Log bei Chunk 0 eines neuen Streams — damit man im adb logcat
|
||||
// sieht warum der Auto-Playback greift oder nicht.
|
||||
if ((payload.chunk ?? 0) === 0 && !this.pcmStreamActive) {
|
||||
console.log('[Audio] PCM-Stream start: silent=%s messageId=%s sr=%s ch=%s',
|
||||
silent, payload.messageId || '(none)',
|
||||
payload.sampleRate, payload.channels);
|
||||
}
|
||||
|
||||
const messageId = payload.messageId || '';
|
||||
const sampleRate = payload.sampleRate || 24000;
|
||||
|
|
|
|||
Loading…
Reference in New Issue