Skip to content

Commit 0d052e4

Browse files
authored
Update fast-search-card.js
1 parent 764bfe6 commit 0d052e4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

dist/fast-search-card.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12446,25 +12446,25 @@ class FastSearchCard extends HTMLElement {
1244612446
let baseDuration;
1244712447

1244812448
if (charCount < 50) {
12449-
// Kurze Texte: 100ms pro Zeichen + Basis
12450-
baseDuration = (charCount * 100) + 800;
12449+
// Kurze Texte: LÄNGER machen
12450+
baseDuration = (charCount * 150) + 1500; // 🆕 War: 100 + 800
1245112451
} else {
12452-
// Längere Texte: Wort-basiert (Ihr Freund's Formel)
12453-
baseDuration = (wordCount / 2.5 * 1000) + (punctuationCount * 400);
12452+
// Längere Texte: auch länger
12453+
baseDuration = (wordCount / 2.0 * 1000) + (punctuationCount * 500); // 🆕 War: 2.5 + 400
1245412454

1245512455
// 🆕 Komplexitäts-Adjustierung
1245612456
baseDuration += (complexityFactor * 50); // Langsamer bei vielen Großbuchstaben
1245712457
}
1245812458

1245912459
// 📏 Dynamische Grenzen basierend auf Text-Länge
12460-
const minDuration = Math.max(2000, charCount * 30);
12460+
const minDuration = Math.max(3000, charCount * 40); // 🆕 War: 2000, 30
1246112461
const maxDuration = Math.min(45000, wordCount * 800);
1246212462

1246312463
const finalDuration = Math.max(minDuration, Math.min(baseDuration, maxDuration));
1246412464

1246512465
console.log(`⏱️ Enhanced TTS Duration: ${Math.round(finalDuration/1000)}s for ${wordCount} words`);
1246612466
return finalDuration;
12467-
}
12467+
}
1246812468

1246912469
// 🎤 SMART TTS EXECUTION (Erweiterte Service-Liste)
1247012470
async executeSmartTTS(text, entityId) {
@@ -12529,10 +12529,10 @@ class FastSearchCard extends HTMLElement {
1252912529
const ttsAge = Date.now() - (this.ttsStartedAt || 0);
1253012530

1253112531
// 🚫 Sicherheits-Checks
12532-
if (ttsAge > 60000) { // Nicht nach 1 Minute
12532+
if (ttsAge > 15000) { // 🆕 War: 60000 - GEÄNDERT zu 15 Sekunden
1253312533
console.log('⏭️ Skipping auto-resume (too old)');
12534-
await this.cleanupTTSState(); // 🆕 HINZUGEFÜGT
12535-
this.updateTTSButtonState('ready'); // 🆕 HINZUGEFÜGT
12534+
await this.cleanupTTSState();
12535+
this.updateTTSButtonState('ready');
1253612536
return;
1253712537
}
1253812538

0 commit comments

Comments
 (0)