// ── Seed Finder — find the best RNG seed for a voice ─────────────────────────
//
// Appended to the voice inspector body by voice-inspector.js.
// Generates audio samples for a voice across a range of seeds so the user
// can listen and pick the most natural-sounding one, then save it to the
// TTS server's voices.json with one click.
const SEED_FINDER_TEXT_DE = (
'Die 3.500 neuen High-End Geräte für das Server-Update benötigen eine ' +
'außergewöhnlich starke Kühlung und regelmäßige Maßnahmen, um die Performance ' +
'bei großer Last zu gewährleisten.'
);
const SEED_FINDER_TEXT_EN = (
'The system administrator successfully configured the customized Docker stacks ' +
'and benchmarked the inference engines at exactly 8:45 AM.'
);
const SEED_FINDER_TEXT_MIXED = SEED_FINDER_TEXT_DE + ' - ' + SEED_FINDER_TEXT_EN;
function _seedFinderDefaultText(voiceId) {
const lc = (voiceId || '').toLowerCase();
if (lc.startsWith('de_')) return SEED_FINDER_TEXT_MIXED;
if (lc.startsWith('en_') || lc.startsWith('gb_')) return SEED_FINDER_TEXT_EN;
return SEED_FINDER_TEXT_MIXED;
}
// Called from voice-inspector.js after the persona panel is appended.
function attachSeedFinder(voiceId, body) {
const panel = document.createElement('div');
panel.className = 'opt-group seed-finder-group';
panel.innerHTML = `
🎲 Seed FinderFind the most natural-sounding voice
Generates audio for each seed so you can listen and pick the best one.
Click "Use this seed" to save it to the TTS server.