Compare commits
2 Commits
1d34143be5
...
fd95af2c40
| Author | SHA1 | Date |
|---|---|---|
|
|
fd95af2c40 | |
|
|
9e12e0001c |
|
|
@ -119,8 +119,13 @@ class PcmStreamPlayerModule(reactContext: ReactApplicationContext) : ReactContex
|
||||||
if (endRequested) {
|
if (endRequested) {
|
||||||
// Falls wir vor Pre-Roll enden (kurzer Text): trotzdem abspielen
|
// Falls wir vor Pre-Roll enden (kurzer Text): trotzdem abspielen
|
||||||
if (!playbackStarted) {
|
if (!playbackStarted) {
|
||||||
try { t.play() } catch (_: Exception) {}
|
try {
|
||||||
playbackStarted = true
|
t.play()
|
||||||
|
playbackStarted = true
|
||||||
|
Log.i(TAG, "Playback gestartet VOR Pre-Roll (kurzer Text, ${bytesBuffered}B gepuffert)")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "play() fallback failed: ${e.message}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return@Thread
|
return@Thread
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -316,6 +316,10 @@ const ChatScreen: React.FC = () => {
|
||||||
// TTS-Audio abspielen wenn vorhanden — respektiert geraetelokalen Mute/Disable
|
// TTS-Audio abspielen wenn vorhanden — respektiert geraetelokalen Mute/Disable
|
||||||
// WICHTIG: via Ref statt direkt state lesen, sonst ist's stale (Closure-Bug).
|
// WICHTIG: via Ref statt direkt state lesen, sonst ist's stale (Closure-Bug).
|
||||||
const canPlay = ttsCanPlayRef.current;
|
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) {
|
if (message.type === 'audio' && message.payload.base64) {
|
||||||
const b64 = message.payload.base64 as string;
|
const b64 = message.payload.base64 as string;
|
||||||
const refId = (message.payload.messageId as string) || '';
|
const refId = (message.payload.messageId as string) || '';
|
||||||
|
|
|
||||||
|
|
@ -459,6 +459,13 @@ class AudioService {
|
||||||
console.warn('[Audio] PcmStreamPlayer Native Module nicht verfuegbar');
|
console.warn('[Audio] PcmStreamPlayer Native Module nicht verfuegbar');
|
||||||
return '';
|
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 messageId = payload.messageId || '';
|
||||||
const sampleRate = payload.sampleRate || 24000;
|
const sampleRate = payload.sampleRate || 24000;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue