From 4eb132e2b03a105ae8dcb898a0725ac16a2c8258 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Fri, 29 May 2026 22:30:37 +0200 Subject: [PATCH] Restore recommended sentence + language switcher to Clone a Voice Adds the 'Read aloud' sample-sentence box back to the microphone card in the Clone a Voice tab. Language switcher covers EN/DE/IT/ES/FR/PT/NL/PL with phonetically diverse sentences (same as the My Voices panel). Uses the existing .sample-read-box / .sample-sentence CSS so it looks identical to the equivalent panel in the voice library. Co-Authored-By: Claude Sonnet 4.6 --- static/js/voice-clone.js | 23 +++++++++++++++++++++++ static/sections/s-clone.html | 16 ++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/static/js/voice-clone.js b/static/js/voice-clone.js index 44158df..6aada29 100644 --- a/static/js/voice-clone.js +++ b/static/js/voice-clone.js @@ -1,3 +1,26 @@ +// ── Clone: recommended sample sentences ────────────────────────────────── + +const CLONE_SAMPLE_TEXTS = { + EN: 'The clear morning light warmed the quiet studio as I described a silver train, a bright red apple, and the gentle rhythm of rain on the window.', + DE: 'Das klare Morgenlicht waermte das ruhige Studio, waehrend ich einen silbernen Zug, einen roten Apfel und den sanften Rhythmus des Regens am Fenster beschrieb.', + IT: "La luce chiara del mattino scaldava lo studio tranquillo mentre descrivevo un treno d'argento, una mela rossa e il ritmo leggero della pioggia alla finestra.", + ES: 'La clara luz de la manana calentaba el estudio tranquilo mientras describia un tren plateado, una manzana roja y el suave ritmo de la lluvia en la ventana.', + FR: 'La lumiere claire du matin rechauffait le studio calme pendant que je decrivais un train argente, une pomme rouge et le doux rythme de la pluie sur la fenetre.', + PT: 'A luz clara da manha aquecia o estudio tranquilo enquanto eu descrevia um comboio prateado, uma maca vermelha e o ritmo suave da chuva na janela.', + NL: 'Het heldere ochtendlicht verwarmde de stille studio terwijl ik een zilveren trein, een rode appel en het zachte ritme van regen op het raam beschreef.', + PL: 'Jasne poranne swiatlo ogrzewalo ciche studio, gdy opisywalem srebrny pociag, czerwone jablko i lagodny rytm deszczu na oknie.', +}; + +(function initCloneSampleText() { + const sel = $('clone-sample-lang'); + const txt = $('clone-sample-text'); + if (!sel || !txt) return; + txt.value = CLONE_SAMPLE_TEXTS[sel.value] || CLONE_SAMPLE_TEXTS.EN; + sel.addEventListener('change', () => { + txt.value = CLONE_SAMPLE_TEXTS[sel.value] || CLONE_SAMPLE_TEXTS.EN; + }); +})(); + // ── WaveSurfer ──────────────────────────────────────────────────────────── let ws = null, wsRegions = null, currentFileId = null, trimmedFileId = null, designedFileId = null, editingVoiceId = null, editingVoicePath = null; diff --git a/static/sections/s-clone.html b/static/sections/s-clone.html index 55b305f..a11d524 100644 --- a/static/sections/s-clone.html +++ b/static/sections/s-clone.html @@ -30,6 +30,22 @@

Microphone

Record a fresh sample with live input level monitoring.

+
+
+ + +
+ +