Skip to content

Commit 0338f25

Browse files
authored
Update fast-search-card.js
1 parent ced1d0d commit 0338f25

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dist/fast-search-card.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12464,8 +12464,10 @@ class FastSearchCard extends HTMLElement {
1246412464
let baseDuration;
1246512465

1246612466
if (charCount < 50) {
12467-
// Kurze Texte: 100ms pro Zeichen + 1s Buffer
12468-
baseDuration = (charCount * 100) + 1000;
12467+
// Kurze Texte: 80ms pro Zeichen + 500ms Buffer
12468+
baseDuration = (charCount * 80) + 500;
12469+
12470+
1246912471
} else {
1247012472
// Längere Texte: Wort-basiert mit Punctuation
1247112473
const punctuationCount = (text.match(/[.!?;,]/g) || []).length;
@@ -12474,8 +12476,8 @@ class FastSearchCard extends HTMLElement {
1247412476
baseDuration = (wordCount / 2.5 * 1000) + (punctuationCount * 300);
1247512477
}
1247612478

12477-
// Minimum 2 Sekunden, Maximum 30 Sekunden
12478-
const finalDuration = Math.max(2000, Math.min(baseDuration, 30000));
12479+
// Minimum 1 Sekunde, Maximum 30 Sekunden
12480+
const finalDuration = Math.max(1000, Math.min(baseDuration, 30000));
1247912481

1248012482
console.log(`⏱️ TTS Duration: ${Math.round(finalDuration/1000)}s for ${wordCount} words`);
1248112483

0 commit comments

Comments
 (0)