The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
feat(speech): the voice picker shows who each voice is, and ends in Clone from a sample
Jareer625549995fab
diff --git a/src/crates/concat-speech/src/tts.rs b/src/crates/concat-speech/src/tts.rsindex a5ba9887..f2dce02e 100644--- a/src/crates/concat-speech/src/tts.rs+++ b/src/crates/concat-speech/src/tts.rs@@ -339,6 +339,12 @@ pub struct VoiceInfo {pub name: String,/// The family whose models read with this voice.pub family: Family,+ /// A picture of the voice, as a path to an image file, for the voice+ /// picker's avatar: none of the stock voices has one, and the picker+ /// draws a letter in a colour instead. For a voice someone adds later+ /// with a picture of their own.+ #[serde(skip_serializing_if = "Option::is_none")]+ pub avatar: Option<String>,}/// A recording to read in the voice of: the clip the sheet was given.@@ -563,11 +569,13 @@ impl Speech {id: *id,name: (*name).to_owned(),family: Family::Kokoro,+ avatar: None,}).chain(POCKET_VOICES.iter().map(|(id, name, _)| VoiceInfo {id: *id,name: (*name).to_owned(),family: Family::Pocket,+ avatar: None,}))// Chatterbox's stock voices are Pocket's recordings, and are// only offered while the bundle holding them is here.@@ -579,6 +587,7 @@ impl Speech {id: *id,name: (*name).to_owned(),family: Family::Chatterbox,+ avatar: None,}),).collect(),diff --git a/src/crates/concat/locales/ar.json b/src/crates/concat/locales/ar.jsonindex 67035933..5960f9f1 100644--- a/src/crates/concat/locales/ar.json+++ b/src/crates/concat/locales/ar.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "متحدّثون مدمجون · سريع","speech.chatterboxHasNoVoice": "لا يملك Chatterbox صوتًا خاصًا به. فعّل «استخدام صوت العيّنة» أدناه، أو نزّل Pocket TTS من الإعدادات › الكلام لاستعارة تسجيليه.","speech.chinese": "صيني",+ "speech.cloneFromSample": "استنساخ من عيّنة…","speech.closestStudioVoiceReads": "الأقرب إلى صوت الاستوديو. يقرأ بإيقاعه الخاص، بأحد تسجيلَي Pocket أو بأي عيّنة من الحاوية، ويقرأ [laugh] و[chuckle] و[sigh] كما تعني.","speech.downloadVoiceModelFirst": "نزّل أولًا نموذج صوت من الإعدادات › الكلام.","speech.expression": "التعبير","speech.female": "أنثى","speech.fine": "دقيق","speech.french": "فرنسي",+ "speech.fromRecordingInBin": "من تسجيل في الحاوية","speech.generateSpeech": "إنشاء الكلام","speech.generatingVoice": "جارٍ إنشاء الصوت","speech.hindi": "هندي",diff --git a/src/crates/concat/locales/bn.json b/src/crates/concat/locales/bn.jsonindex 489f44c3..048b1fdb 100644--- a/src/crates/concat/locales/bn.json+++ b/src/crates/concat/locales/bn.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "বিল্ট-ইন স্পিকার · দ্রুত","speech.chatterboxHasNoVoice": "ChatterBox-এর নিজস্ব কোনো কণ্ঠ নেই। নিচে নমুনা কণ্ঠ ব্যবহার করুন চালু করুন, অথবা এর দুটি রেকর্ডিং ব্যবহার করতে সেটিংস › স্পিচ থেকে Pocket TTS ডাউনলোড করুন।","speech.chinese": "চীনা",+ "speech.cloneFromSample": "নমুনা থেকে ক্লোন করুন…","speech.closestStudioVoiceReads": "স্টুডিও কণ্ঠের সবচেয়ে কাছাকাছি। নিজের গতিতে পড়ে — Pocket-এর দুটি রেকর্ডিংয়ের একটিতে বা বিনের যেকোনো নমুনায় — এবং [laugh], [chuckle] ও [sigh] যেমন লেখা থাকে তেমনই পড়ে।","speech.downloadVoiceModelFirst": "আগে সেটিংস › স্পিচ থেকে একটি ভয়েস মডেল ডাউনলোড করুন।","speech.expression": "অভিব্যক্তি","speech.female": "নারী","speech.fine": "ভালো","speech.french": "ফরাসি",+ "speech.fromRecordingInBin": "বিনের একটি রেকর্ডিং থেকে","speech.generateSpeech": "স্পিচ তৈরি করুন","speech.generatingVoice": "কণ্ঠ তৈরি হচ্ছে","speech.hindi": "হিন্দি",diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.jsonindex 609caef9..98351e3e 100644--- a/src/crates/concat/locales/de.json+++ b/src/crates/concat/locales/de.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Eingebaute Sprecher · schnell","speech.chatterboxHasNoVoice": "Chatterbox hat keine eigene Stimme. Schalte unten Beispielstimme verwenden ein oder lade Pocket TTS unter Einstellungen › Sprache herunter, um dir seine zwei Aufnahmen zu leihen.","speech.chinese": "Chinesisch",+ "speech.cloneFromSample": "Aus einer Probe klonen…","speech.closestStudioVoiceReads": "Am nächsten an einer Studiostimme. Liest in eigenem Tempo, in einer der zwei Aufnahmen von Pocket oder in jeder Probe aus den Medien, und liest [laugh], [chuckle] und [sigh] als das, was sie sagen.","speech.downloadVoiceModelFirst": "Lade zuerst ein Stimmmodell unter Einstellungen › Sprache herunter.","speech.expression": "Ausdruck","speech.female": "weiblich","speech.fine": "Fein","speech.french": "Französisch",+ "speech.fromRecordingInBin": "Aus einer Aufnahme in den Medien","speech.generateSpeech": "Sprache erzeugen","speech.generatingVoice": "Stimme wird erzeugt","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.jsonindex 72becba8..62587f11 100644--- a/src/crates/concat/locales/en.json+++ b/src/crates/concat/locales/en.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Built-in speakers · fast","speech.chatterboxHasNoVoice": "Chatterbox has no voice of its own. Turn on Use sample voice below, or download Pocket TTS in Settings › Speech to borrow its two recordings.","speech.chinese": "Chinese",+ "speech.cloneFromSample": "Clone from a sample…","speech.closestStudioVoiceReads": "The closest to a studio voice. Reads at its own pace, in one of Pocket's two recordings or in any sample from the bin, and reads [laugh], [chuckle] and [sigh] as what they say.","speech.downloadVoiceModelFirst": "Download a voice model in Settings › Speech first.","speech.expression": "Expression","speech.female": "female","speech.fine": "Fine","speech.french": "French",+ "speech.fromRecordingInBin": "From a recording in the bin","speech.generateSpeech": "Generate speech","speech.generatingVoice": "Generating voice","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.jsonindex 4edb7ee4..bc48b6fb 100644--- a/src/crates/concat/locales/es.json+++ b/src/crates/concat/locales/es.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Voces integradas · rápido","speech.chatterboxHasNoVoice": "Chatterbox no tiene voz propia. Activa Usar voz de muestra más abajo, o descarga Pocket TTS en Ajustes › Voz para tomar prestadas sus dos grabaciones.","speech.chinese": "Chino",+ "speech.cloneFromSample": "Clonar desde una muestra…","speech.closestStudioVoiceReads": "La más cercana a una voz de estudio. Lee a su propio ritmo, con una de las dos grabaciones de Pocket o con cualquier muestra de la biblioteca de medios, y lee [laugh], [chuckle] y [sigh] como lo que dicen.","speech.downloadVoiceModelFirst": "Descarga primero un modelo de voz en Ajustes › Voz.","speech.expression": "Expresión","speech.female": "femenina","speech.fine": "Fino","speech.french": "Francés",+ "speech.fromRecordingInBin": "De una grabación de la biblioteca de medios","speech.generateSpeech": "Generar voz","speech.generatingVoice": "Generando voz","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.jsonindex 71261ffe..6242bde3 100644--- a/src/crates/concat/locales/fa.json+++ b/src/crates/concat/locales/fa.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "گویندههای داخلی · سریع","speech.chatterboxHasNoVoice": "Chatterbox صدایی از خودش ندارد. گزینه «استفاده از صدای نمونه» را در پایین روشن کنید، یا Pocket TTS را از تنظیمات › گفتار دانلود کنید تا از دو ضبط آن استفاده شود.","speech.chinese": "چینی",+ "speech.cloneFromSample": "شبیهسازی از یک نمونه…","speech.closestStudioVoiceReads": "نزدیکترین به یک صدای استودیویی. با سرعت خودش میخواند، با یکی از دو ضبط Pocket یا هر نمونهای از Bin، و [laugh]، [chuckle] و [sigh] را همانطور که هستند اجرا میکند.","speech.downloadVoiceModelFirst": "ابتدا یک صدا مدل را از تنظیمات › گفتار دانلود کنید.","speech.expression": "بیان","speech.female": "زن","speech.fine": "ریز","speech.french": "فرانسوی",+ "speech.fromRecordingInBin": "از یک ضبط در Bin","speech.generateSpeech": "ساخت گفتار","speech.generatingVoice": "در حال ساخت صدا","speech.hindi": "هندی",diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.jsonindex d9c0f5dc..c6f159b9 100644--- a/src/crates/concat/locales/fr.json+++ b/src/crates/concat/locales/fr.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Voix intégrées · rapide","speech.chatterboxHasNoVoice": "Chatterbox n'a pas de voix à lui. Activez Utiliser une voix d'échantillon ci-dessous, ou téléchargez Pocket TTS dans Réglages › Voix pour emprunter ses deux enregistrements.","speech.chinese": "Chinois",+ "speech.cloneFromSample": "Cloner depuis un échantillon…","speech.closestStudioVoiceReads": "Ce qui se rapproche le plus d'une voix de studio. Lit à son propre rythme, avec l'un des deux enregistrements de Pocket ou n'importe quel échantillon du chutier, et lit [laugh], [chuckle] et [sigh] comme ce qu'ils disent.","speech.downloadVoiceModelFirst": "Téléchargez d'abord un modèle de voix dans Réglages › Voix.","speech.expression": "Expressivité","speech.female": "féminine","speech.fine": "Fin","speech.french": "Français",+ "speech.fromRecordingInBin": "D'un enregistrement du chutier","speech.generateSpeech": "Générer la voix","speech.generatingVoice": "Génération de la voix","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/he.json b/src/crates/concat/locales/he.jsonindex 29be9a88..4a13707a 100644--- a/src/crates/concat/locales/he.json+++ b/src/crates/concat/locales/he.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "דוברים מובנים · מהיר","speech.chatterboxHasNoVoice": "ל-Chatterbox אין קול משלו. יש להפעיל את ״שימוש בקול מדגימה״ למטה, או להוריד את Pocket TTS בהגדרות › דיבור כדי לשאול את שתי ההקלטות שלו.","speech.chinese": "סינית",+ "speech.cloneFromSample": "שכפול מדגימה…","speech.closestStudioVoiceReads": "הכי קרוב לקול אולפן. קורא בקצב משלו, באחת משתי ההקלטות של Pocket או בכל דגימה מהמאגר, וקורא את [laugh], [chuckle] ו-[sigh] כפי שהם.","speech.downloadVoiceModelFirst": "יש להוריד קודם מודל קול בהגדרות › דיבור.","speech.expression": "הבעה","speech.female": "נקבה","speech.fine": "מדויק","speech.french": "צרפתית",+ "speech.fromRecordingInBin": "מהקלטה במאגר","speech.generateSpeech": "יצירת דיבור","speech.generatingVoice": "יוצר קול","speech.hindi": "הינדי",diff --git a/src/crates/concat/locales/hi.json b/src/crates/concat/locales/hi.jsonindex 3e709d06..4c663e3e 100644--- a/src/crates/concat/locales/hi.json+++ b/src/crates/concat/locales/hi.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "बिल्ट-इन वक्ता · तेज़","speech.chatterboxHasNoVoice": "Chatterbox की अपनी कोई आवाज़ नहीं है। नीचे नमूना आवाज़ इस्तेमाल करें चालू करें, या उसकी दो रिकॉर्डिंग उधार लेने के लिए सेटिंग › स्पीच में Pocket TTS डाउनलोड करें।","speech.chinese": "चीनी",+ "speech.cloneFromSample": "नमूने से क्लोन करें…","speech.closestStudioVoiceReads": "स्टूडियो आवाज़ के सबसे करीब। अपनी गति से पढ़ता है, Pocket की दो रिकॉर्डिंग में से किसी एक की आवाज़ में या बिन के किसी भी नमूने की आवाज़ में, और [laugh], [chuckle] और [sigh] को उनके अर्थ के अनुसार अदा करता है।","speech.downloadVoiceModelFirst": "पहले सेटिंग › स्पीच में कोई आवाज़ मॉडल डाउनलोड करें।","speech.expression": "भाव","speech.female": "महिला","speech.fine": "बारीक","speech.french": "फ़्रेंच",+ "speech.fromRecordingInBin": "बिन की किसी रिकॉर्डिंग से","speech.generateSpeech": "आवाज़ बनाएं","speech.generatingVoice": "आवाज़ बनाई जा रही है","speech.hindi": "हिन्दी",diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.jsonindex 7d03a1c4..40c39c85 100644--- a/src/crates/concat/locales/hr.json+++ b/src/crates/concat/locales/hr.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Ugrađeni govornici · brzo","speech.chatterboxHasNoVoice": "Chatterbox nema vlastiti glas. Uključite Koristi uzorak glasa ispod ili preuzmite Pocket TTS u Postavke › Govor da posudite njegove dvije snimke.","speech.chinese": "kineski",+ "speech.cloneFromSample": "Kloniraj iz uzorka…","speech.closestStudioVoiceReads": "Najbliže studijskom glasu. Čita vlastitim tempom, u jednoj od dviju Pocketovih snimki ili u bilo kojem uzorku iz spremnika, a [laugh], [chuckle] i [sigh] čita kao ono što znače.","speech.downloadVoiceModelFirst": "Prvo preuzmite glasovni model u Postavke › Govor.","speech.expression": "Izraz","speech.female": "ženski","speech.fine": "Fino","speech.french": "francuski",+ "speech.fromRecordingInBin": "Iz snimke u spremniku","speech.generateSpeech": "Generiraj govor","speech.generatingVoice": "Generiranje glasa","speech.hindi": "hindski",diff --git a/src/crates/concat/locales/id.json b/src/crates/concat/locales/id.jsonindex d4754e3d..dbe4358a 100644--- a/src/crates/concat/locales/id.json+++ b/src/crates/concat/locales/id.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Pembicara bawaan · cepat","speech.chatterboxHasNoVoice": "Chatterbox tidak punya suara sendiri. Aktifkan Gunakan suara sampel di bawah, atau unduh Pocket TTS di Pengaturan › Ucapan untuk meminjam dua rekamannya.","speech.chinese": "Tionghoa",+ "speech.cloneFromSample": "Klon dari sampel…","speech.closestStudioVoiceReads": "Paling mendekati suara studio. Membaca dengan temponya sendiri, dengan salah satu dari dua rekaman Pocket atau sampel apa pun dari bin, dan membawakan [laugh], [chuckle], dan [sigh] sesuai artinya.","speech.downloadVoiceModelFirst": "Unduh dulu model suara di Pengaturan › Ucapan.","speech.expression": "Ekspresi","speech.female": "perempuan","speech.fine": "Halus","speech.french": "Prancis",+ "speech.fromRecordingInBin": "Dari rekaman di bin","speech.generateSpeech": "Buat ucapan","speech.generatingVoice": "Membuat suara","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.jsonindex 748de4ab..21edbbb0 100644--- a/src/crates/concat/locales/it.json+++ b/src/crates/concat/locales/it.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Voci integrate · veloce","speech.chatterboxHasNoVoice": "Chatterbox non ha una voce propria. Attiva Usa la voce campione qui sotto, oppure scarica Pocket TTS in Impostazioni › Voce per prendere in prestito le sue due registrazioni.","speech.chinese": "Cinese",+ "speech.cloneFromSample": "Clona da un campione…","speech.closestStudioVoiceReads": "La più vicina a una voce da studio. Legge al proprio ritmo, con una delle due registrazioni di Pocket o con qualsiasi campione dal pannello Media, e legge [laugh], [chuckle] e [sigh] come ciò che dicono.","speech.downloadVoiceModelFirst": "Scarica prima un modello vocale in Impostazioni › Voce.","speech.expression": "Espressione","speech.female": "femminile","speech.fine": "Accurata","speech.french": "Francese",+ "speech.fromRecordingInBin": "Da una registrazione del pannello Media","speech.generateSpeech": "Genera voce","speech.generatingVoice": "Generazione della voce","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.jsonindex b4b14a52..c2abec09 100644--- a/src/crates/concat/locales/ja.json+++ b/src/crates/concat/locales/ja.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "内蔵の話者 · 高速","speech.chatterboxHasNoVoice": "Chatterbox には固有の声がありません。下の「サンプルの声を使う」をオンにするか、「設定 › 音声」で Pocket TTS をダウンロードしてその 2つの録音を借りてください。","speech.chinese": "中国語",+ "speech.cloneFromSample": "サンプルから複製…","speech.closestStudioVoiceReads": "スタジオの声に最も近いもの。Pocket の 2つの録音のどちらか、またはビンの任意のサンプルの声で、自分のペースで読み上げ、[laugh]、[chuckle]、[sigh] はその意味どおりに読みます。","speech.downloadVoiceModelFirst": "まず「設定 › 音声」で音声モデルをダウンロードしてください。","speech.expression": "エクスプレッション","speech.female": "女性","speech.fine": "細かい","speech.french": "フランス語",+ "speech.fromRecordingInBin": "ビンの録音から","speech.generateSpeech": "音声を生成","speech.generatingVoice": "音声を生成中","speech.hindi": "ヒンディー語",diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.jsonindex 18b26fcc..6f047789 100644--- a/src/crates/concat/locales/ko.json+++ b/src/crates/concat/locales/ko.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "내장 화자 · 빠름","speech.chatterboxHasNoVoice": "Chatterbox에는 자체 목소리가 없습니다. 아래에서 샘플 목소리 사용을 켜거나, 설정 › 음성에서 Pocket TTS를 다운로드해 그 녹음 두 개를 빌려 쓰세요.","speech.chinese": "중국어",+ "speech.cloneFromSample": "샘플로 복제…","speech.closestStudioVoiceReads": "스튜디오 목소리에 가장 가깝습니다. Pocket의 녹음 두 개 중 하나나 미디어 빈의 어떤 샘플로든 제 속도로 읽고, [laugh], [chuckle], [sigh]는 그 뜻대로 소리 냅니다.","speech.downloadVoiceModelFirst": "먼저 설정 › 음성에서 음성 모델을 다운로드하세요.","speech.expression": "표현","speech.female": "여성","speech.fine": "정밀","speech.french": "프랑스어",+ "speech.fromRecordingInBin": "미디어 빈의 녹음에서","speech.generateSpeech": "음성 생성","speech.generatingVoice": "음성 생성 중","speech.hindi": "힌디어",diff --git a/src/crates/concat/locales/nl.json b/src/crates/concat/locales/nl.jsonindex d651867e..e3c998e1 100644--- a/src/crates/concat/locales/nl.json+++ b/src/crates/concat/locales/nl.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Ingebouwde sprekers · snel","speech.chatterboxHasNoVoice": "Chatterbox heeft geen eigen stem. Zet hieronder Samplestem gebruiken aan, of download Pocket TTS via Instellingen › Spraak om de twee opnames daarvan te lenen.","speech.chinese": "Chinees",+ "speech.cloneFromSample": "Klonen uit een sample…","speech.closestStudioVoiceReads": "Het dichtst bij een studiostem. Leest in zijn eigen tempo, met een van de twee opnames van Pocket of met een sample uit de mediabak, en leest [laugh], [chuckle] en [sigh] als wat ze zeggen.","speech.downloadVoiceModelFirst": "Download eerst een stemmodel via Instellingen › Spraak.","speech.expression": "Expressie","speech.female": "vrouw","speech.fine": "Nauwkeurig","speech.french": "Frans",+ "speech.fromRecordingInBin": "Uit een opname in de mediabak","speech.generateSpeech": "Spraak genereren","speech.generatingVoice": "Stem genereren","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/pl.json b/src/crates/concat/locales/pl.jsonindex 26c0da36..7c64ea71 100644--- a/src/crates/concat/locales/pl.json+++ b/src/crates/concat/locales/pl.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Wbudowani lektorzy · szybko","speech.chatterboxHasNoVoice": "Chatterbox nie ma własnego głosu. Włącz poniżej Użyj głosu z próbki albo pobierz Pocket TTS w Ustawienia › Mowa, aby pożyczyć jego dwa nagrania.","speech.chinese": "chiński",+ "speech.cloneFromSample": "Sklonuj z próbki…","speech.closestStudioVoiceReads": "Najbliżej głosu studyjnego. Czyta we własnym tempie, jednym z dwóch nagrań Pocket lub dowolną próbką z pojemnika, a [laugh], [chuckle] i [sigh] odczytuje jako to, co oznaczają.","speech.downloadVoiceModelFirst": "Najpierw pobierz model głosu w Ustawienia › Mowa.","speech.expression": "Ekspresja","speech.female": "kobieta","speech.fine": "Dokładnie","speech.french": "francuski",+ "speech.fromRecordingInBin": "Z nagrania w pojemniku","speech.generateSpeech": "Generuj mowę","speech.generatingVoice": "Generowanie głosu","speech.hindi": "hindi",diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.jsonindex 1667ea29..701e7890 100644--- a/src/crates/concat/locales/pt-BR.json+++ b/src/crates/concat/locales/pt-BR.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Vozes internas · rápido","speech.chatterboxHasNoVoice": "O Chatterbox não tem voz própria. Ative Usar voz de amostra abaixo, ou baixe o Pocket TTS em Configurações › Fala para emprestar suas duas gravações.","speech.chinese": "Chinês",+ "speech.cloneFromSample": "Clonar de uma amostra…","speech.closestStudioVoiceReads": "A mais próxima de uma voz de estúdio. Lê no próprio ritmo, numa das duas gravações do Pocket ou em qualquer amostra da biblioteca, e lê [laugh], [chuckle] e [sigh] como o que eles dizem.","speech.downloadVoiceModelFirst": "Baixe primeiro um modelo de voz em Configurações › Fala.","speech.expression": "Expressão","speech.female": "feminina","speech.fine": "Fino","speech.french": "Francês",+ "speech.fromRecordingInBin": "De uma gravação da biblioteca","speech.generateSpeech": "Gerar fala","speech.generatingVoice": "Gerando voz","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.jsonindex be46d8c5..e82b6193 100644--- a/src/crates/concat/locales/ru.json+++ b/src/crates/concat/locales/ru.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Встроенные голоса · быстро","speech.chatterboxHasNoVoice": "У Chatterbox нет собственного голоса. Включите ниже «Голос из образца» или скачайте Pocket TTS в Настройки › Речь, чтобы взять его две записи.","speech.chinese": "Китайский",+ "speech.cloneFromSample": "Клонировать из образца…","speech.closestStudioVoiceReads": "Ближе всего к студийному голосу. Читает в своём темпе, одной из двух записей Pocket или любым образцом из медиа, а [laugh], [chuckle] и [sigh] исполняет как написано.","speech.downloadVoiceModelFirst": "Сначала скачайте голосовую модель в Настройки › Речь.","speech.expression": "Выразительность","speech.female": "женский","speech.fine": "Точное","speech.french": "Французский",+ "speech.fromRecordingInBin": "Из записи в медиа","speech.generateSpeech": "Создать речь","speech.generatingVoice": "Создание голоса","speech.hindi": "Хинди",diff --git a/src/crates/concat/locales/th.json b/src/crates/concat/locales/th.jsonindex e6b6c587..1e5b5d9f 100644--- a/src/crates/concat/locales/th.json+++ b/src/crates/concat/locales/th.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "ผู้พูดในตัว · เร็ว","speech.chatterboxHasNoVoice": "Chatterbox ไม่มีเสียงของตัวเอง เปิด ใช้เสียงตัวอย่าง ด้านล่าง หรือดาวน์โหลด Pocket TTS ที่ การตั้งค่า › เสียงพูด เพื่อยืมไฟล์บันทึกสองไฟล์ของมัน","speech.chinese": "จีน",+ "speech.cloneFromSample": "โคลนจากตัวอย่าง…","speech.closestStudioVoiceReads": "ใกล้เคียงเสียงสตูดิโอที่สุด อ่านตามจังหวะของตัวเอง ด้วยหนึ่งในสองไฟล์บันทึกของ Pocket หรือตัวอย่างใดก็ได้จากคลังสื่อ และแสดง [laugh], [chuckle] และ [sigh] ออกมาตามความหมาย","speech.downloadVoiceModelFirst": "ดาวน์โหลดโมเดลเสียงก่อนที่ การตั้งค่า › เสียงพูด","speech.expression": "อารมณ์","speech.female": "หญิง","speech.fine": "ละเอียด","speech.french": "ฝรั่งเศส",+ "speech.fromRecordingInBin": "จากไฟล์บันทึกในคลังสื่อ","speech.generateSpeech": "สร้างเสียงพูด","speech.generatingVoice": "กำลังสร้างเสียง","speech.hindi": "ฮินดี",diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.jsonindex b83e46a7..cb191c46 100644--- a/src/crates/concat/locales/tr.json+++ b/src/crates/concat/locales/tr.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Yerleşik konuşmacılar · hızlı","speech.chatterboxHasNoVoice": "Chatterbox'ın kendine ait bir sesi yok. Aşağıdaki Örnek sesi kullan seçeneğini açın ya da iki kaydını ödünç almak için Ayarlar › Konuşma bölümünden Pocket TTS'i indirin.","speech.chinese": "Çince",+ "speech.cloneFromSample": "Örnekten klonla…","speech.closestStudioVoiceReads": "Stüdyo sesine en yakın olanı. Kendi temposunda, Pocket'ın iki kaydından biriyle ya da medya kutusundaki herhangi bir örnekle okur; [laugh], [chuckle] ve [sigh] etiketlerini söyledikleri gibi okur.","speech.downloadVoiceModelFirst": "Önce Ayarlar › Konuşma bölümünden bir ses modeli indirin.","speech.expression": "İfade","speech.female": "kadın","speech.fine": "Hassas","speech.french": "Fransızca",+ "speech.fromRecordingInBin": "Medya kutusundaki bir kayıttan","speech.generateSpeech": "Konuşma oluştur","speech.generatingVoice": "Ses oluşturuluyor","speech.hindi": "Hintçe",diff --git a/src/crates/concat/locales/uk.json b/src/crates/concat/locales/uk.jsonindex ca64c793..af8f9af6 100644--- a/src/crates/concat/locales/uk.json+++ b/src/crates/concat/locales/uk.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Вбудовані голоси · швидко","speech.chatterboxHasNoVoice": "Chatterbox не має власного голосу. Увімкніть «Використати голос зі зразка» нижче або завантажте Pocket TTS у Налаштування › Мовлення, щоб позичити його два записи.","speech.chinese": "китайський",+ "speech.cloneFromSample": "Клонувати зі зразка…","speech.closestStudioVoiceReads": "Найближче до студійного голосу. Читає у власному темпі одним із двох записів Pocket або будь-яким зразком із медіатеки, а [laugh], [chuckle] і [sigh] відтворює як сміх, смішок і зітхання.","speech.downloadVoiceModelFirst": "Спершу завантажте голосову модель у Налаштування › Мовлення.","speech.expression": "Виразність","speech.female": "жіночий","speech.fine": "Точно","speech.french": "французький",+ "speech.fromRecordingInBin": "Із запису в медіатеці","speech.generateSpeech": "Створити мовлення","speech.generatingVoice": "Створення голосу","speech.hindi": "гінді",diff --git a/src/crates/concat/locales/ur.json b/src/crates/concat/locales/ur.jsonindex 317c9db0..a972c47e 100644--- a/src/crates/concat/locales/ur.json+++ b/src/crates/concat/locales/ur.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "بلٹ اِن بولنے والے · تیز","speech.chatterboxHasNoVoice": "Chatterbox کی اپنی کوئی آواز نہیں۔ نیچے «نمونے کی آواز استعمال کریں» آن کریں، یا اس کی دو ریکارڈنگز ادھار لینے کے لیے ترتیبات › گفتگو میں Pocket TTS ڈاؤن لوڈ کریں۔","speech.chinese": "چینی",+ "speech.cloneFromSample": "نمونے سے کلون کریں…","speech.closestStudioVoiceReads": "اسٹوڈیو کی آواز کے سب سے قریب۔ اپنی رفتار سے پڑھتا ہے، Pocket کی دو ریکارڈنگز میں سے کسی ایک میں یا بِن کے کسی بھی نمونے میں، اور [laugh]، [chuckle] اور [sigh] کو ان کے معنی کے مطابق ادا کرتا ہے۔","speech.downloadVoiceModelFirst": "پہلے ترتیبات › گفتگو میں سے کوئی آواز کا ماڈل ڈاؤن لوڈ کریں۔","speech.expression": "اظہار","speech.female": "خاتون","speech.fine": "باریک","speech.french": "فرانسیسی",+ "speech.fromRecordingInBin": "بِن کی کسی ریکارڈنگ سے","speech.generateSpeech": "گفتگو بنائیں","speech.generatingVoice": "آواز بنائی جا رہی ہے","speech.hindi": "ہندی",diff --git a/src/crates/concat/locales/vi.json b/src/crates/concat/locales/vi.jsonindex d0f8a343..2d4e3d55 100644--- a/src/crates/concat/locales/vi.json+++ b/src/crates/concat/locales/vi.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "Giọng có sẵn · nhanh","speech.chatterboxHasNoVoice": "Chatterbox không có giọng riêng. Bật Sử dụng giọng mẫu bên dưới hoặc tải Pocket TTS trong Cài đặt › Giọng nói để mượn một trong hai bản ghi âm của nó.","speech.chinese": "Trung Quốc",+ "speech.cloneFromSample": "Nhân bản từ mẫu…","speech.closestStudioVoiceReads": "Giọng gần với giọng phòng thu nhất. Đọc theo tốc độ riêng, bằng một trong hai bản ghi của Pocket hoặc bất kỳ mẫu nào trong thư viện; đồng thời đọc [laugh], [chuckle] và [sigh] theo đúng ý nghĩa.","speech.downloadVoiceModelFirst": "Trước tiên, hãy tải mô hình giọng nói trong Cài đặt › Giọng nói.","speech.expression": "Biểu cảm","speech.female": "nữ","speech.fine": "Tinh chỉnh","speech.french": "Pháp",+ "speech.fromRecordingInBin": "Từ một bản ghi âm trong thư viện","speech.generateSpeech": "Tạo giọng nói","speech.generatingVoice": "Đang tạo giọng nói","speech.hindi": "Hindi",diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.jsonindex a3d536a1..486a6150 100644--- a/src/crates/concat/locales/zh-Hans.json+++ b/src/crates/concat/locales/zh-Hans.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "内置扬声器 · 快速","speech.chatterboxHasNoVoice": "Chatterbox 没有自带的语音。请打开下方的“使用示例语音”,或在“设置 › 语音”中下载 Pocket TTS,借用它的两段录音。","speech.chinese": "中文",+ "speech.cloneFromSample": "从样本克隆…","speech.closestStudioVoiceReads": "最接近录音室人声。按自己的节奏朗读,可使用 Pocket 的两段录音之一或素材箱中的任意样本,并会把 [laugh]、[chuckle] 和 [sigh] 读成相应的笑声与叹息。","speech.downloadVoiceModelFirst": "请先在“设置 › 语音”中下载语音模型。","speech.expression": "表情","speech.female": "女声","speech.fine": "精细","speech.french": "法语",+ "speech.fromRecordingInBin": "来自媒体库中的录音","speech.generateSpeech": "生成语音","speech.generatingVoice": "正在生成语音","speech.hindi": "印地语",diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.jsonindex 12fc2732..e7b21708 100644--- a/src/crates/concat/locales/zh-TW.json+++ b/src/crates/concat/locales/zh-TW.json@@ -516,12 +516,14 @@"speech.builtInSpeakersFast": "內建揚聲器 · 快速","speech.chatterboxHasNoVoice": "Chatterbox 沒有內建語音。請打開下方的「使用範例語音」,或在「設定 › 語音」中下載 Pocket TTS,借用它的兩段錄音。","speech.chinese": "中文",+ "speech.cloneFromSample": "從樣本複製…","speech.closestStudioVoiceReads": "最接近錄音室人聲。依自己的節奏朗讀,可使用 Pocket 的兩段錄音之一或素材箱中的任意樣本,並會把 [laugh]、[chuckle] 和 [sigh] 讀成相應的笑聲與嘆息。","speech.downloadVoiceModelFirst": "請先在「設定 › 語音」中下載語音模型。","speech.expression": "表情","speech.female": "女聲","speech.fine": "精細","speech.french": "法文",+ "speech.fromRecordingInBin": "來自媒體庫中的錄音","speech.generateSpeech": "產生語音","speech.generatingVoice": "正在產生語音","speech.hindi": "印地語",diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rsindex 8261ba0c..30277a05 100644--- a/src/crates/concat/src/lib.rs+++ b/src/crates/concat/src/lib.rs@@ -363,6 +363,7 @@ fn start(project: Option<std::path::PathBuf>, smoke: bool) -> Result<(), slint::app.set_speech_model_details(ModelRc::from(models.speech_model_details.clone()));app.set_speech_voices(ModelRc::from(models.speakers.clone()));app.set_speech_voice_details(ModelRc::from(models.speaker_details.clone()));+ app.set_speech_voice_avatars(ModelRc::from(models.speaker_avatars.clone()));app.set_speech_samples(ModelRc::from(models.speech_samples.clone()));app.set_speech_sample_waves(ModelRc::from(models.speech_sample_waves.clone()));app.set_speech_sample_details(ModelRc::from(models.speech_sample_details.clone()));diff --git a/src/crates/concat/src/panes/speech.rs b/src/crates/concat/src/panes/speech.rsindex 82a19598..74316a21 100644--- a/src/crates/concat/src/panes/speech.rs+++ b/src/crates/concat/src/panes/speech.rs@@ -190,7 +190,18 @@ impl SpeechPane {}SpeechMsg::Close => self.open = false,SpeechMsg::TextEdited(text) => self.text = text,- SpeechMsg::VoiceChanged(index) => self.voice = index.max(0) as usize,+ // The row past the named voices is "Clone from a sample…":+ // the sample switch, turned on from where a voice is chosen.+ SpeechMsg::VoiceChanged(index) => {+ let index = index.max(0) as usize;+ if index >= self.offered().len() {+ if self.sample_voice().is_some() {+ self.use_sample = true;+ }+ } else {+ self.voice = index;+ }+ }SpeechMsg::ModelChanged(index) => {self.model = index.max(0) as usize;// Another model may read with other voices: the list is@@ -521,11 +532,13 @@ impl SpeechPane {.unwrap_or(0)}- /// The voice list's rows: each offered voice's name.+ /// The voice list's rows: each offered voice's name, and last, for a+ /// model that reads in a recording, the row that clones one.pub fn speaker_rows(&self) -> Vec<SharedString> {self.offered().iter().map(|speaker| voice_label(&speaker.name).0.into())+ .chain(self.clone_row().then(|| t("speech.cloneFromSample").into())).collect()}@@ -535,9 +548,46 @@ impl SpeechPane {self.offered().iter().map(|speaker| voice_label(&speaker.name).1.into())+ .chain(+ self.clone_row()+ .then(|| t("speech.fromRecordingInBin").into()),+ ).collect()}+ /// The voice list's avatars: a voice's picture where it has one, else+ /// the first letter of its name in the colour its name picks; and a+ /// plain mark for the clone row, which is nobody yet.+ pub fn speaker_avatar_rows(&self) -> Vec<crate::ui::AvatarData> {+ self.offered()+ .iter()+ .map(|speaker| {+ let name = voice_label(&speaker.name).0;+ let picture = speaker+ .avatar+ .as_deref()+ .and_then(|path| slint::Image::load_from_path(path.as_ref()).ok());+ crate::ui::AvatarData {+ letter: avatar_letter(&name).into(),+ hue: avatar_hue(&name),+ pictured: picture.is_some(),+ picture: picture.unwrap_or_default(),+ }+ })+ .chain(self.clone_row().then(|| crate::ui::AvatarData {+ letter: "+".into(),+ hue: -1,+ ..Default::default()+ }))+ .collect()+ }++ /// Whether the voice list ends in "Clone from a sample…": the model+ /// reads in a recording, so one can stand in for a named voice.+ fn clone_row(&self) -> bool {+ self.sample_voice().is_some()+ }+/// The model list's second lines: what each model is for, in a few/// words, since which one is chosen decides everything under it.pub fn model_detail_rows(&self, studio: &Studio) -> Vec<SharedString> {@@ -594,6 +644,7 @@ impl SpeechPane {open: self.open,text: self.text.as_str().into(),voice: self.voice as i32,+ voice_count: self.offered().len() as i32,model: self.model as i32,family: match self.family {Family::Kokoro => 0,@@ -703,9 +754,48 @@ fn voice_label(name: &str) -> (String, String) {(title, detail)}+/// The letter a voice's avatar shows: the first of its first name.+fn avatar_letter(name: &str) -> String {+ name.split_whitespace()+ .next()+ .and_then(|first| first.chars().next())+ .map(|letter| letter.to_uppercase().collect())+ .unwrap_or_default()+}++/// Which of the avatar palette's eight hues a voice's name picks: a hash+/// of the name (FNV-1a), so a voice keeps its colour from run to run.+fn avatar_hue(name: &str) -> i32 {+ let hash = name+ .to_lowercase()+ .bytes()+ .fold(0x811c_9dc5_u32, |hash, byte| {+ (hash ^ u32::from(byte)).wrapping_mul(0x0100_0193)+ });+ (hash % 8) as i32+}+#[cfg(test)]mod tests {- use super::{insert_tag, voice_label};+ use super::{avatar_hue, avatar_letter, insert_tag, voice_label};++ /// An avatar is the first letter of the first name, in a colour the+ /// name settles: the same every time, one of the palette's eight.+ #[test]+ fn a_voice_avatar_is_its_initial_in_its_own_colour() {+ assert_eq!(avatar_letter("Bria"), "B");+ assert_eq!(avatar_letter("émile dupont"), "É");+ assert_eq!(avatar_letter(""), "");+ assert_eq!(avatar_hue("Bria"), avatar_hue("bria"));+ let hues: std::collections::HashSet<i32> = [+ "Bria", "Adam", "Heart", "Lewis", "Nova", "Sky", "Eric", "Alba",+ ]+ .iter()+ .map(|name| avatar_hue(name))+ .collect();+ assert!(hues.iter().all(|hue| (0..8).contains(hue)));+ assert!(hues.len() > 2, "names spread over the palette: {hues:?}");+ }/// A tag lands as a word of its own wherever the caret is: spaced off a/// word on either side, not doubled against a space already there, anddiff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rsindex 4971c43b..67754a31 100644--- a/src/crates/concat/src/studio.rs+++ b/src/crates/concat/src/studio.rs@@ -666,6 +666,7 @@ pub struct Models {pub speech_model_details: Rc<VecModel<SharedString>>,pub speakers: Rc<VecModel<SharedString>>,pub speaker_details: Rc<VecModel<SharedString>>,+ pub speaker_avatars: Rc<VecModel<crate::ui::AvatarData>>,pub speech_samples: Rc<VecModel<SharedString>>,/// The microphones the voiceover panel lists.pub voiceover_devices: Rc<VecModel<SharedString>>,@@ -735,6 +736,7 @@ impl Models {speech_model_details: Rc::new(VecModel::default()),speakers: Rc::new(VecModel::default()),speaker_details: Rc::new(VecModel::default()),+ speaker_avatars: Rc::new(VecModel::default()),speech_samples: Rc::new(VecModel::default()),voiceover_devices: Rc::new(VecModel::default()),speech_sample_waves: Rc::new(VecModel::default()),@@ -10719,6 +10721,7 @@ impl Studio {);sync(&models.speakers, self.speech.speaker_rows());sync(&models.speaker_details, self.speech.speaker_detail_rows());+ sync(&models.speaker_avatars, self.speech.speaker_avatar_rows());sync(&models.speech_samples, self.speech.sample_rows(self));sync(&models.speech_sample_waves,diff --git a/src/crates/concat/ui/app.slint b/src/crates/concat/ui/app.slintindex ea630861..54580fb7 100644--- a/src/crates/concat/ui/app.slint+++ b/src/crates/concat/ui/app.slint@@ -28,6 +28,7 @@ import { RelinkDialog, RelinkData, MissingMediaItem } from "dialogs/relink.slintimport { ConfirmData, ConfirmDialog } from "dialogs/confirm.slint";import { CaptionsDialog, CaptionsSheetData } from "dialogs/captions.slint";import { SpeechDialog, SpeechSheetData } from "dialogs/speech.slint";+import { AvatarData } from "primitives/avatar.slint";import { VoiceoverData, VoiceoverPanel } from "dialogs/voiceover.slint";import { DockDivider, DockSide, SeatBox } from "dock.slint";import { Editor } from "editor.slint";@@ -313,6 +314,8 @@ export component App inherits Window {in property <[string]> speech-model-details;in property <[string]> speech-voices;in property <[string]> speech-voice-details;+ /// Each voice's avatar; see Avatar.+ in property <[AvatarData]> speech-voice-avatars;/// The recordings in the bin a voice can be taken from: their names,/// their waveforms as path commands, and their lengths.in property <[string]> speech-samples;@@ -695,6 +698,7 @@ export component App inherits Window {model-details: root.speech-model-details;voices: root.speech-voices;voice-details: root.speech-voice-details;+ voice-avatars: root.speech-voice-avatars;samples: root.speech-samples;sample-waves: root.speech-sample-waves;sample-details: root.speech-sample-details;diff --git a/src/crates/concat/ui/dialogs/speech.slint b/src/crates/concat/ui/dialogs/speech.slintindex a818f105..f61af43a 100644--- a/src/crates/concat/ui/dialogs/speech.slint+++ b/src/crates/concat/ui/dialogs/speech.slint@@ -7,6 +7,7 @@ import { Glyph, Icon } from "../icons.slint";import { Button, CopyChip, DialogRow, DialogSection, Modal, Progress } from "../primitives/modal.slint";import { SegmentedControl } from "../primitives/segmented-control.slint";import { Select } from "../primitives/select.slint";+import { AvatarData } from "../primitives/avatar.slint";import { Rail } from "../inspector/controls.slint";import { Wave } from "../primitives/wave.slint";import { Fmt } from "../util.slint";@@ -36,6 +37,9 @@ export struct SpeechSheetData {text: string,/// Row in the voice list.voice: int,+ /// How many named voices the list holds: past them, the last row is+ /// "Clone from a sample…" when the model reads in a recording.+ voice-count: int,/// Row in the installed voice model list.model: int,/// 0 Kokoro, 1 Pocket TTS, 2 Chatterbox: which controls the model has.@@ -230,6 +234,8 @@ export component SpeechDialog inherits Modal {in property <[string]> voices;/// "American · female", beside each voice.in property <[string]> voice-details;+ /// Each voice's avatar: its picture, or its first letter in its colour.+ in property <[AvatarData]> voice-avatars;/// The bin's recordings a voice can be taken from: their names, their/// envelopes as path commands, and their lengths.in property <[string]> samples;@@ -293,7 +299,7 @@ export component SpeechDialog inherits Modal {property <bool> has-reference: !root.data.use-sample || root.data.sample-name != "";/// There is a voice to read with: a sample, or a named one on the list./// Chatterbox names none until Pocket's recordings are on disk.- property <bool> has-voice: root.data.use-sample || root.voices.length > 0;+ property <bool> has-voice: root.data.use-sample || root.data.voice-count > 0;/// Seconds since the run began; the reference beside the bar.property <int> elapsed;@@ -409,13 +415,17 @@ export component SpeechDialog inherits Modal {}}- // The named voices, while a sample is not standing in for them.+ // The named voices, while a sample is not standing in for them,+ // each with its avatar; and last, for a model that reads in a+ // recording, the way to read in one's own - the sample switch+ // below, found from where a voice is chosen.if !root.data.use-sample: DialogRow {label: I18n.t("speech.voice");Select {options: root.voices;details: root.voice-details;- current: root.data.voice;+ avatars: root.voice-avatars;+ current: root.data.voice-count > 0 ? root.data.voice : -1;placeholder: I18n.t("speech.none");enabled: root.voices.length > 0;changed(index) => { root.voice-changed(index); }@@ -425,7 +435,7 @@ export component SpeechDialog inherits Modal {// Chatterbox ships no recording of anyone's, so its named voices// are Pocket's two, borrowed while Pocket is on disk. With// neither there is nothing to read with but a sample.- if root.data.family == 2 && root.voices.length == 0 && !root.data.use-sample: Text {+ if root.data.family == 2 && root.data.voice-count == 0 && !root.data.use-sample: Text {text: I18n.t("speech.chatterboxHasNoVoice");color: Theme.danger;font-size: Theme.fs-sm;diff --git a/src/crates/concat/ui/primitives/avatar.slint b/src/crates/concat/ui/primitives/avatar.slintnew file mode 100644index 00000000..f8426692--- /dev/null+++ b/src/crates/concat/ui/primitives/avatar.slint@@ -0,0 +1,79 @@+// SPDX-License-Identifier: AGPL-3.0-or-later+// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors++import { Theme } from "../theme/theme.slint";++// Who a row is: a picture in a circle, or where there is none, the first+// letter of the name in a circle of a colour the name chooses.+//+// The colour is one of eight, picked by Rust from a hash of the name, so a+// voice keeps its colour from one run to the next and two voices beside+// each other rarely share one. Each is a light tint of the hue on a dark+// shade of it - the letter and its ground one colour - which reads the+// same on the dark theme and the light: the circle carries its own+// contrast and does not lean on what is behind it. A `hue` of -1 is no+// colour at all, for a row that is not a person (a "clone from a sample"+// row): the field's own grey, the letter a mark.+export struct AvatarData {+ /// The letter shown when there is no picture: the name's first.+ letter: string,+ /// 0..7, one of the palette's hues; -1 for neutral.+ hue: int,+ /// The picture, when there is one.+ picture: image,+ pictured: bool,+}++export global AvatarPalette {+ out property <[color]> grounds: [+ #5b2530, // red+ #5c3518, // orange+ #4f4313, // amber+ #1f4a2c, // green+ #164848, // teal+ #1d3a63, // blue+ #3b2a66, // violet+ #5a2350, // pink+ ];+ out property <[color]> inks: [+ #ffc2cc,+ #ffd2a8,+ #ffe9a3,+ #b9f0c8,+ #aeeeee,+ #bcd6ff,+ #d6c8ff,+ #ffc4f0,+ ];+}++export component Avatar inherits Rectangle {+ in property <AvatarData> data;+ in property <length> size: 18px;++ property <bool> hued: root.data.hue >= 0 && root.data.hue < AvatarPalette.grounds.length;++ width: root.size;+ height: root.size;+ border-radius: root.size / 2;+ clip: true;+ background: root.hued ? AvatarPalette.grounds[root.data.hue] : Theme.field-active;++ if root.data.pictured: Image {+ width: parent.width;+ height: parent.height;+ source: root.data.picture;+ image-fit: cover;+ }++ if !root.data.pictured: Text {+ width: parent.width;+ height: parent.height;+ text: root.data.letter;+ color: root.hued ? AvatarPalette.inks[root.data.hue] : Theme.fg-muted;+ font-size: root.size * 0.52;+ font-weight: 600;+ horizontal-alignment: center;+ vertical-alignment: center;+ }+}diff --git a/src/crates/concat/ui/primitives/select.slint b/src/crates/concat/ui/primitives/select.slintindex a4469fff..2e27e937 100644--- a/src/crates/concat/ui/primitives/select.slint+++ b/src/crates/concat/ui/primitives/select.slint@@ -6,6 +6,7 @@ import { Glyph, Icon } from "../icons.slint";import { FocusRing } from "focus-ring.slint";import { Tip } from "tooltip.slint";import { ThinScrollbar } from "scrollbar.slint";+import { Avatar, AvatarData } from "avatar.slint";// Custom listbox dropdown rather than a native combo box, so options can carry// icons and match the panel styling. Arrows, Home/End, Enter and Escape all@@ -30,6 +31,12 @@ export component Select inherits Rectangle {/// words of "Sort: Added" cost more room than they earn. Shorter than/// `options` is fine; a row past its end simply has none.in property <[Glyph]> icons;+ /// One avatar per option, in the same order: a round picture or a+ /// letter in a colour, before each row's words and before the+ /// trigger's - for a list of who, like voices, where a face or a+ /// colour is found faster than a name is read. Shorter than `options`+ /// is fine; a row past its end simply has none.+ in property <[AvatarData]> avatars;in property <bool> enabled: true;/// Rows that are shown and cannot be picked, by index: greyed, and a/// press or Enter on one does nothing. Shorter than `options` leaves@@ -87,6 +94,11 @@ export component Select inherits Rectangle {property <Glyph> mark: root.marked ? root.icons[root.current] : Glyph.none;/// the mark on the trigger, at the size of the glyph it replacesproperty <length> mark-size: 14px;+ /// The current option has an avatar, which the trigger shows before+ /// its words.+ property <bool> pictured: root.current >= 0 && root.current < root.avatars.length;+ /// What the avatars add to a row: the circle and the gap after it.+ property <length> avatar-w: root.avatars.length > 0 ? 18px + 6px : 0px;/// What the trigger needs to show its options whole: the padding, the/// chevron, the optional glyph, and the gaps between them. A select set@@ -101,7 +113,8 @@ export component Select inherits Rectangle {+ (root.marked? root.mark-size: (root.snug ? shown.preferred-width : measure.preferred-width)- + (root.glyph != Glyph.none ? 12px + 6px : 0px));+ + (root.glyph != Glyph.none ? 12px + 6px : 0px)+ + root.avatar-w);height: Theme.h;min-width: 60px;@@ -190,6 +203,14 @@ export component Select inherits Rectangle {}}+ if !root.marked && root.pictured: VerticalLayout {+ alignment: center;+ Avatar {+ data: root.avatars[root.current];+ size: 18px;+ }+ }+if !root.marked: Text {horizontal-stretch: 1;text: root.label;@@ -256,7 +277,7 @@ export component Select inherits Rectangle {/// A marked trigger is only as wide as its icon, and the list it opens/// is the one place the options are written, so the list may not/// inherit that width.- property <length> list-w: Math.max(root.width, measure.preferred-width + 59px);+ property <length> list-w: Math.max(root.width, measure.preferred-width + 59px + root.avatar-w);list := PopupWindow {// Right edge on the trigger's right edge: a list wider than an@@ -353,6 +374,15 @@ export component Select inherits Rectangle {}}+ if index < root.avatars.length: VerticalLayout {+ alignment: center;+ Avatar {+ data: root.avatars[index];+ size: 18px;+ opacity: root.off(index) ? 0.45 : 1.0;+ }+ }+Text {horizontal-stretch: 1;text: option;