Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

perf(speech): the voices run on CoreML on every Mac, and fall back to the CPU on their own

Jareer2a18815c6cba
diff --git a/src/crates/concat-speech/src/chatterbox.rs b/src/crates/concat-speech/src/chatterbox.rs
index 7714adf3..576a1aa6 100644
--- a/src/crates/concat-speech/src/chatterbox.rs
+++ b/src/crates/concat-speech/src/chatterbox.rs
@@ -273,9 +273,9 @@ struct Voice {
/// One network, opened for the CPU or, when asked and where the build has
/// it, for CoreML: the Mac's GPU and Neural Engine. CoreML takes the parts
-/// of a graph it knows and hands the rest back to the CPU, and a graph it
-/// cannot take at all still runs - slower, not broken - so asking for it
-/// is safe; the log says which it got.
+/// of a graph it knows and hands the rest back to the CPU; a network it
+/// refuses outright fails here, and the caller loads the bundle for the
+/// CPU instead. The log says which it got.
fn session(path: &Path, accelerated: bool) -> Result<Session, String> {
let threads = std::thread::available_parallelism()
.map(|count| count.get())
diff --git a/src/crates/concat-speech/src/lib.rs b/src/crates/concat-speech/src/lib.rs
index 56727632..9157831f 100644
--- a/src/crates/concat-speech/src/lib.rs
+++ b/src/crates/concat-speech/src/lib.rs
@@ -25,28 +25,15 @@ pub mod tts;
pub use transcribe::Transcriber;
pub use tts::Speech;
-/// Whether the voices run on the machine's own accelerator where the build
-/// has one, or on the CPU. Process-wide, the way `concat_media`'s hardware
-/// decode preference is: Settings › Speech sets it, and an engine reads it
-/// as it loads - one already loaded the other way is loaded again on the
-/// next read. Off until asked, because the accelerator is a bet: CoreML
-/// runs the parts of a network it knows and hands the rest back to the
-/// CPU, and which parts those are is the model's business.
-static ACCELERATED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
-
-/// Asks the engines to run on the accelerator, or not to.
-pub fn set_accelerated(on: bool) {
- ACCELERATED.store(on, std::sync::atomic::Ordering::Relaxed);
-}
-
-/// Whether the engines are asked to run on the accelerator.
-pub fn accelerated() -> bool {
- ACCELERATED.load(std::sync::atomic::Ordering::Relaxed)
-}
-
-/// Whether this build has an accelerator to offer at all: CoreML, on a
-/// Mac. Elsewhere the switch is not shown, since it would do nothing.
-pub const fn acceleration_offered() -> bool {
+/// Whether the voices ask for the machine's own accelerator: CoreML, the
+/// Mac's GPU and Neural Engine. Not a setting. Measured on an M5 against
+/// the CPU, a warm read took 10.3 s against 14.8 for Kokoro (and came out
+/// sample for sample the same), 5.6 against 6.5 for Pocket and 48.6
+/// against 60.6 for Chatterbox. The one cost is Chatterbox's load, about
+/// eleven seconds longer while CoreML compiles its networks, paid once per
+/// run since the engine stays loaded. A model that will not load for CoreML
+/// at all loads for the CPU instead (tts.rs).
+pub const fn accelerated() -> bool {
cfg!(target_os = "macos")
}
diff --git a/src/crates/concat-speech/src/tts.rs b/src/crates/concat-speech/src/tts.rs
index dc4cd29d..cb916109 100644
--- a/src/crates/concat-speech/src/tts.rs
+++ b/src/crates/concat-speech/src/tts.rs
@@ -415,9 +415,6 @@ enum Engine {
struct CachedEngine {
model_id: String,
- /// Loaded for the accelerator, or for the CPU; a change of mind loads
- /// the model again.
- accelerated: bool,
tts: Engine,
}
@@ -695,30 +692,45 @@ impl Speech {
.engine
.lock()
.map_err(|_| "speech state poisoned".to_owned())?;
- let accelerated = crate::accelerated();
- let stale = engine.as_ref().is_none_or(|cached| {
- cached.model_id != request.model_id || cached.accelerated != accelerated
- });
+ let stale = engine
+ .as_ref()
+ .is_none_or(|cached| cached.model_id != request.model_id);
if stale {
// Load before overwriting: a failed load keeps the old engine.
let loading = std::time::Instant::now();
- log::info!(
- "tts: loading {} from {} for the {}",
- request.model_id,
- dir.display(),
- if accelerated { "accelerator" } else { "CPU" }
- );
- let tts = match family {
- Family::Kokoro => Engine::Sherpa(load_kokoro(&dir, accelerated)?),
- Family::Pocket => Engine::Sherpa(load_pocket(&dir, accelerated)?),
- #[cfg(feature = "chatterbox")]
- Family::Chatterbox => Engine::Chatterbox(Box::new(
- crate::chatterbox::Engine::load(&dir, accelerated)?,
- )),
- #[cfg(not(feature = "chatterbox"))]
- Family::Chatterbox => {
- return Err("Chatterbox is not part of this build".to_owned());
+ let load = |accelerated: bool| -> Result<Engine, String> {
+ log::info!(
+ "tts: loading {} from {} for the {}",
+ request.model_id,
+ dir.display(),
+ if accelerated { "accelerator" } else { "CPU" }
+ );
+ Ok(match family {
+ Family::Kokoro => Engine::Sherpa(load_kokoro(&dir, accelerated)?),
+ Family::Pocket => Engine::Sherpa(load_pocket(&dir, accelerated)?),
+ #[cfg(feature = "chatterbox")]
+ Family::Chatterbox => Engine::Chatterbox(Box::new(
+ crate::chatterbox::Engine::load(&dir, accelerated)?,
+ )),
+ #[cfg(not(feature = "chatterbox"))]
+ Family::Chatterbox => {
+ return Err("Chatterbox is not part of this build".to_owned());
+ }
+ })
+ };
+ // The accelerator where there is one, and the CPU when a model
+ // will not load for it: slower is better than not at all, and
+ // nobody should have to find a setting to get the voice back.
+ let tts = match load(crate::accelerated()) {
+ Ok(tts) => tts,
+ Err(error) if crate::accelerated() => {
+ log::warn!(
+ "tts: {} would not load on the accelerator ({error}); loading it for the CPU",
+ request.model_id
+ );
+ load(false)?
}
+ Err(error) => return Err(error),
};
log::info!(
"tts: {} loaded in {:.1}s",
@@ -727,7 +739,6 @@ impl Speech {
);
*engine = Some(CachedEngine {
model_id: request.model_id.clone(),
- accelerated,
tts,
});
}
@@ -1008,8 +1019,8 @@ fn load_pocket(dir: &Path, accelerated: bool) -> Result<OfflineTts, String> {
.ok_or_else(|| "the speech engine failed to load - try re-downloading the model".to_owned())
}
-/// The ONNX Runtime provider sherpa is asked for: CoreML on a Mac that
-/// wants the accelerator, the CPU otherwise. sherpa falls back to the CPU
+/// The ONNX Runtime provider sherpa is asked for: CoreML on a Mac, the CPU
+/// otherwise, and the CPU when the load for CoreML failed. sherpa falls back to the CPU
/// itself, with a line in the log, where its runtime was built without
/// the one asked for.
fn provider(accelerated: bool) -> &'static str {
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.json
index 7b7a597a..4267a82c 100644
--- a/src/crates/concat/locales/de.json
+++ b/src/crates/concat/locales/de.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "Ölgemälde",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "Ein, Löschen eines Clips zieht alles, was auf derselben Spur folgt, in die Lücke, und Kürzen einer Kante nimmt den Rest der Spur mit. Aus, Löschen lässt eine Lücke und Kürzen bewegt nur die Kante. Umschalt-Löschen schließt die Lücke in beiden Fällen.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "Ein, die Stimmen laufen über CoreML auf der GPU und der Neural Engine dieses Macs, wo das Modell es erlaubt, und sonst auf der CPU. Aus, alles läuft auf der CPU. Gilt ab dem nächsten Vorlesen; ein bereits geladenes Modell wird erneut geladen.",
"One repeat, fading.": "Eine Wiederholung, ausklingend.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "Ein Titel pro gesprochenem Satz, im Takt der Wörter geschnitten, auf der ersten freien Spur.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.json
index dfb05f32..4aea4df5 100644
--- a/src/crates/concat/locales/en.json
+++ b/src/crates/concat/locales/en.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "Oil Paint",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.",
"One repeat, fading.": "One repeat, fading.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "One title per phrase spoken, cut to the words' own timing, on the first lane with room.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.json
index 3c113e30..9f3cca05 100644
--- a/src/crates/concat/locales/es.json
+++ b/src/crates/concat/locales/es.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "Pintura al óleo",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "Activado, eliminar un clip arrastra lo que le sigue en la misma pista hacia el hueco, y recortar un borde mueve el resto de la pista con él. Desactivado, eliminar deja un hueco y recortar mueve solo el borde. Mayús-Supr cierra el hueco en ambos casos.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "Activado, las voces se ejecutan en la GPU y el Neural Engine de este Mac a través de CoreML donde el modelo lo permite, y en la CPU donde no. Desactivado, todo se ejecuta en la CPU. Surte efecto en la siguiente lectura; un modelo ya cargado se carga de nuevo.",
"One repeat, fading.": "Una repetición que se desvanece.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "Un título por frase hablada, ajustado al ritmo de las palabras, en la primera pista con espacio.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.json
index 41640d19..b4d25039 100644
--- a/src/crates/concat/locales/fa.json
+++ b/src/crates/concat/locales/fa.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "در حالت خاموش، با کلیک روی خط‌کش بعد از آخرین کلیپ، نشانگر پخش همان‌جا قرار می‌گیرد و کلیپ قرارگرفته در نشانگر پخش نیز به همان نقطه می‌رود. در حالت On، نشانگر پخش هیچ‌وقت از محدوده محتوا خارج نمی‌شود.",
"Oil Paint": "نقاشی رنگ‌روغن",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "در حالت On، حذف یک کلیپ هر چیزی را که بعد از آن روی همان ترک است به داخل فاصله می‌کشد و برش یک لبه بقیه ترک را همراه خود جابه‌جا می‌کند. در حالت خاموش، حذف یک فاصله باقی می‌گذارد و برش فقط لبه را جابه‌جا می‌کند. Shift-Delete در هر دو حالت فاصله را می‌بندد.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "در حالت On، صداها هر جا که مدل اجازه دهد از طریق CoreML روی GPU و Neural Engine همین Mac اجرا می‌شوند و در غیر این صورت روی CPU. در حالت خاموش، همه چیز روی CPU اجرا می‌شود. از خواندن بعدی اعمال می‌شود؛ مدلی که از قبل بارگذاری شده دوباره بارگذاری می‌شود.",
"One repeat, fading.": "یک بار تکرار با محو شدن.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "برای هر Phrase گفته‌شده یک عنوان ساخته می‌شود، با Timing خود کلمات، روی اولین لاین دارای فضای کافی.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "برای هر جمله یک عنوان ساخته می‌شود و به‌اندازه زمان لازم برای خواندن نمایش داده می‌شود؛ پشت سر هم روی اولین لاین دارای فضای کافی.",
diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.json
index 368a9269..d9e5caa3 100644
--- a/src/crates/concat/locales/fr.json
+++ b/src/crates/concat/locales/fr.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "Peinture à l'huile",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "Activé, supprimer un clip tire ce qui le suit sur la même piste dans l'espace laissé, et rogner un bord déplace le reste de la piste avec lui. Désactivé, une suppression laisse un espace et un rognage ne déplace que le bord. Maj-Suppr referme l'espace dans les deux cas.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "Activé, les voix tournent sur le GPU et le Neural Engine de ce Mac via CoreML partout où le modèle le permet, et sur le CPU là où il ne le permet pas. Désactivé, tout tourne sur le CPU. Prend effet à la prochaine lecture ; un modèle déjà chargé est rechargé.",
"One repeat, fading.": "Une répétition qui s'estompe.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "Un titre par phrase prononcée, calé sur le rythme des mots, sur la première piste libre.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.json
index f6f427cd..6036257e 100644
--- a/src/crates/concat/locales/hr.json
+++ b/src/crates/concat/locales/hr.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Isključeno: klik na ravnalo iza zadnjeg klipa spušta playhead tamo, a klip postavljen na playhead ide s njim. Uključeno: playhead nikad ne napušta sadržaj.",
"Oil Paint": "Uljna slika",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "Uključeno, brisanje klipa povlači ono što slijedi na istoj traci u prazninu, a skraćivanje ruba pomiče ostatak trake s njim. Isključeno, brisanje ostavlja prazninu, a skraćivanje pomiče samo rub. Shift-Delete zatvara prazninu u oba slučaja.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "Uključeno, glasovi rade na GPU-u i Neural Engineu ovog Maca kroz CoreML gdje god model dopušta, a na CPU-u gdje ne dopušta. Isključeno, sve radi na CPU-u. Vrijedi od sljedećeg čitanja; već učitani model učitava se ponovno.",
"One repeat, fading.": "Jedno ponavljanje, uz blijedjenje.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "Jedan naslov po izgovorenoj frazi, rezan na vlastiti tajming riječi, na prvoj traci s mjesta.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "Jedan naslov po rečenici, držan dok se ne pročita, jedan za drugim na prvoj traci s mjesta.",
diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.json
index f9b928c4..74f6efde 100644
--- a/src/crates/concat/locales/it.json
+++ b/src/crates/concat/locales/it.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "Pittura a olio",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "Attivo, eliminare una clip tira ciò che la segue sulla stessa traccia dentro lo spazio, e accorciare un bordo sposta con sé il resto della traccia. Disattivato, un'eliminazione lascia uno spazio e un accorciamento sposta solo il bordo. Maiusc-Elimina chiude lo spazio in ogni caso.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "Attivo, le voci girano sulla GPU e sul Neural Engine di questo Mac tramite CoreML dove il modello lo consente, e sulla CPU dove non lo consente. Disattivato, tutto gira sulla CPU. Ha effetto alla prossima lettura; un modello già caricato viene caricato di nuovo.",
"One repeat, fading.": "Una ripetizione che sfuma.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "Un titolo per ogni frase pronunciata, tagliato sul ritmo delle parole, sulla prima traccia libera.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.json
index 4f00cbb3..834b634c 100644
--- a/src/crates/concat/locales/ja.json
+++ b/src/crates/concat/locales/ja.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "油彩",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "オンのとき、クリップを削除すると同じトラックの後続が隙間に引き寄せられ、端をトリミングするとトラックの残りも一緒に動きます。オフのとき、削除は隙間を残し、トリミングは端だけを動かします。Shift-Delete はどちらでも隙間を詰めます。",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "オンのとき、モデルが許す範囲で声は CoreML を通じてこの Mac の GPU と Neural Engine で動き、許さない部分は CPU で動きます。オフのとき、すべて CPU で動きます。次の読み上げから反映され、すでに読み込まれたモデルは再度読み込まれます。",
"One repeat, fading.": "一回の繰り返しがフェードします。",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "発話されたフレーズごとにタイトルを一つ、言葉のタイミングどおりに、空いている最初のレーンへ。",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.json
index ef8d9fa0..7de7fe07 100644
--- a/src/crates/concat/locales/ko.json
+++ b/src/crates/concat/locales/ko.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "유화",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "켜면 클립을 삭제할 때 같은 트랙의 뒤따르는 클립이 빈틈으로 당겨지고, 가장자리를 다듬으면 트랙의 나머지가 함께 움직입니다. 끄면 삭제는 빈틈을 남기고 다듬기는 가장자리만 움직입니다. Shift-Delete는 어느 쪽이든 빈틈을 닫습니다.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "켜면 모델이 허용하는 곳에서는 CoreML을 통해 이 Mac의 GPU와 Neural Engine에서 목소리를 실행하고, 그렇지 않은 곳에서는 CPU에서 실행합니다. 끄면 모든 것이 CPU에서 실행됩니다. 다음 읽기부터 적용되며, 이미 불러온 모델은 다시 불러옵니다.",
"One repeat, fading.": "한 번 반복하며 사라집니다.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "말한 구절마다 자막 하나씩, 말의 타이밍에 맞춰, 자리가 있는 첫 레인에 놓습니다.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.json
index a5431f5d..ba62fb05 100644
--- a/src/crates/concat/locales/pt-BR.json
+++ b/src/crates/concat/locales/pt-BR.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "Pintura a óleo",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "Ligado, excluir um clipe puxa o que vem depois dele na mesma faixa para a lacuna, e aparar uma borda move o resto da faixa junto. Desligado, uma exclusão deixa uma lacuna e um aparo move só a borda. Shift-Delete fecha a lacuna de qualquer jeito.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "Ligado, as vozes rodam na GPU e no Neural Engine deste Mac por meio do CoreML onde o modelo permitir, e na CPU onde não. Desligado, tudo roda na CPU. Vale a partir da próxima leitura; um modelo já carregado é carregado de novo.",
"One repeat, fading.": "Uma repetição que se esvai.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "Um título por frase falada, no ritmo das palavras, na primeira faixa com espaço.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.json
index 29198dc0..35d2992f 100644
--- a/src/crates/concat/locales/ru.json
+++ b/src/crates/concat/locales/ru.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Выкл: щелчок по линейке за последним клипом ставит курсор туда, и клип, поставленный по курсору, ляжет там же. Вкл: курсор никогда не выходит за содержимое.",
"Oil Paint": "Масляная живопись",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "Вкл: удаление клипа подтягивает всё, что идёт за ним на той же дорожке, в пробел, а подрезка края двигает остаток дорожки вместе с ним. Выкл: удаление оставляет пробел, подрезка двигает только край. Shift-Delete закрывает пробел в любом случае.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "Вкл: голоса работают на GPU и Neural Engine этого Mac через CoreML везде, где позволяет модель, и на CPU там, где нет. Выкл: всё работает на CPU. Вступает в силу при следующем чтении; уже загруженная модель загружается заново.",
"One repeat, fading.": "Один повтор, затухающий.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "Один титр на каждую произнесённую фразу, в такт словам, на первой свободной дорожке.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "Один титр на предложение, держится столько, сколько нужно, чтобы прочитать, один за другим на первой свободной дорожке.",
diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.json
index 05728eda..bddb36d6 100644
--- a/src/crates/concat/locales/tr.json
+++ b/src/crates/concat/locales/tr.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.",
"Oil Paint": "Yağlı boya",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "Açıkken bir klibi silmek aynı parçada onu izleyenleri boşluğa çeker ve bir kenarı kırpmak parçanın geri kalanını da onunla taşır. Kapalıyken silme bir boşluk bırakır ve kırpma yalnızca kenarı taşır. Shift-Delete her iki durumda da boşluğu kapatır.",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "Açıkken sesler, modelin izin verdiği her yerde CoreML aracılığıyla bu Mac'in GPU'sunda ve Neural Engine'inde, izin vermediği yerde CPU'da çalışır. Kapalıyken her şey CPU'da çalışır. Bir sonraki okumada etkili olur; zaten yüklenmiş bir model yeniden yüklenir.",
"One repeat, fading.": "Sönen tek bir tekrar.",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "Söylenen her cümle için bir yazı, kelimelerin kendi zamanlamasıyla, yeri olan ilk şeritte.",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "One title per sentence, held for as long as it takes to read, one after another on the first lane with room.",
diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.json
index 8d1d1a85..9a7a2fbe 100644
--- a/src/crates/concat/locales/zh-Hans.json
+++ b/src/crates/concat/locales/zh-Hans.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "关闭时,在标尺上点击最后一个片段之后的位置,播放头会停在那里,放置在播放头处的片段也随之落在该处。开启时,播放头始终不会离开内容范围。",
"Oil Paint": "油画",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "开启时,删除片段会把同一轨道上其后的内容拉进空隙,修剪边缘时轨道上的其余内容也随之移动。关闭时,删除会留下空隙,修剪只移动边缘。无论开关与否,Shift-Delete 都会合拢空隙。",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "开启时,只要模型允许,语音就会通过 CoreML 在这台 Mac 的 GPU 和神经网络引擎上运行,不允许的部分则在 CPU 上运行。关闭时,全部在 CPU 上运行。下次朗读时生效;已加载的模型会重新加载。",
"One repeat, fading.": "重复一次,逐渐淡出。",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "每个口语短语一个标题,按词语本身的时间切分,放在第一条有空位的轨道上。",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "每句一个标题,停留足够阅读的时长,依次排列在第一条有空位的轨道上。",
diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.json
index 38cd1bd4..23e1a28c 100644
--- a/src/crates/concat/locales/zh-TW.json
+++ b/src/crates/concat/locales/zh-TW.json
@@ -578,7 +578,6 @@
"Off, a click on the ruler past the last clip lands the playhead there, and a clip placed at the playhead goes with it. On, the playhead never leaves the content.": "關閉時,在尺標上點按最後一個片段之後的位置,播放磁頭會停在該處,放置於播放磁頭的片段也隨之落在該處。開啟時,播放磁頭永遠不會離開內容範圍。",
"Oil Paint": "油畫",
"On, deleting a clip pulls what follows it on the same track into the gap, and trimming an edge moves the rest of the track with it. Off, a delete leaves a gap and a trim moves only the edge. Shift-Delete closes the gap either way.": "開啟時,刪除片段會把同一軌道上其後的內容拉進空隙,修剪邊緣時軌道上的其餘內容也隨之移動。關閉時,刪除會留下空隙,修剪只移動邊緣。無論開關與否,Shift-Delete 都會閉合空隙。",
- "On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.": "開啟時,只要模型允許,語音就會透過 CoreML 在這台 Mac 的 GPU 和神經網路引擎上執行,不允許的部分則在 CPU 上執行。關閉時,全部在 CPU 上執行。下次朗讀時生效;已載入的模型會重新載入。",
"One repeat, fading.": "重複一次,逐漸淡出。",
"One title per phrase spoken, cut to the words' own timing, on the first lane with room.": "每個口說片語一個標題,依字詞本身的時間切分,放在第一條有空位的軌道上。",
"One title per sentence, held for as long as it takes to read, one after another on the first lane with room.": "每句一個標題,停留足夠閱讀的時間,依序排列在第一條有空位的軌道上。",
diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rs
index 12d48db2..d1a8ce04 100644
--- a/src/crates/concat/src/lib.rs
+++ b/src/crates/concat/src/lib.rs
@@ -1284,9 +1284,6 @@ pub fn run() -> Result<(), slint::PlatformError> {
app.on_settings_magnetic_changed(on_window!(|state, on: bool| {
state.handle(Msg::Settings(SettingsMsg::MagneticChanged(on)));
}));
- app.on_settings_speech_accelerated_changed(on_window!(|state, on: bool| {
- state.handle(Msg::Settings(SettingsMsg::SpeechAcceleratedChanged(on)));
- }));
app.on_settings_download_source_changed(on_window!(|state, index: i32| {
state.handle(Msg::Settings(SettingsMsg::DownloadSourceChanged(index)));
}));
diff --git a/src/crates/concat/src/panes/settings.rs b/src/crates/concat/src/panes/settings.rs
index 9eb05dd0..468b4646 100644
--- a/src/crates/concat/src/panes/settings.rs
+++ b/src/crates/concat/src/panes/settings.rs
@@ -41,8 +41,6 @@ pub enum SettingsMsg {
PlayheadStopsChanged(bool),
/// The magnetic timeline switch; the tray's button is the same fact.
MagneticChanged(bool),
- /// The voices run on the accelerator.
- SpeechAcceleratedChanged(bool),
DownloadSourceChanged(i32),
DownloadBaseEdited(String),
ServerEnabledChanged(bool),
@@ -135,8 +133,6 @@ pub struct SettingsPane {
pub language: usize,
/// The switch that keeps the playhead inside the content.
pub playhead_stops: bool,
- /// The voices run on the machine's accelerator.
- pub speech_accelerated: bool,
/// Index into `SourcePreference::ALL`: where model downloads look first.
pub download_source: usize,
/// The base URL of a custom download source.
@@ -169,8 +165,6 @@ impl SettingsPane {
// in software (concat_media::hardware). Linux has no default
// device, so there this is software as before.
concat_media::set_hardware_decode(true);
- self.speech_accelerated = studio.prefs.speech_accelerated;
- concat_speech::set_accelerated(self.speech_accelerated);
self.download_source = Self::download_source(studio).0;
self.download_base = studio.prefs.download_base.clone().unwrap_or_default();
Self::apply_download_source(studio);
@@ -219,14 +213,6 @@ impl SettingsPane {
studio.prefs.magnetic = on;
studio.prefs.save(&studio.host.dirs);
}
- SettingsMsg::SpeechAcceleratedChanged(on) => {
- self.speech_accelerated = on;
- studio.prefs.speech_accelerated = on;
- studio.prefs.save(&studio.host.dirs);
- // An engine already loaded the other way is loaded again on
- // the next read; nothing running is disturbed.
- concat_speech::set_accelerated(on);
- }
SettingsMsg::DownloadSourceChanged(index) => {
let index = (index.max(0) as usize).min(SourcePreference::ALL.len() - 1);
self.download_source = index;
@@ -562,8 +548,6 @@ impl SettingsPane {
language: self.language as i32,
playhead_stops: self.playhead_stops,
magnetic: studio.prefs.magnetic,
- speech_accelerated: self.speech_accelerated,
- speech_acceleration_offered: concat_speech::acceleration_offered(),
download_source: self.download_source as i32,
download_base: self.download_base.as_str().into(),
server_enabled: studio.prefs.server.enabled,
diff --git a/src/crates/concat/src/prefs.rs b/src/crates/concat/src/prefs.rs
index 7eb3d6ee..450ffa00 100644
--- a/src/crates/concat/src/prefs.rs
+++ b/src/crates/concat/src/prefs.rs
@@ -60,11 +60,6 @@ pub struct Preferences {
/// default: a burst of sound on every pass of the pointer is a lot to
/// ask of a room.
pub preview_axis_audio: bool,
- /// The voices run on the machine's own accelerator - CoreML on a Mac -
- /// rather than the CPU. Off by default: what the accelerator takes of
- /// a network is the network's business, and the CPU is the answer that
- /// is always right.
- pub speech_accelerated: bool,
/// Where model downloads look first: a `SourcePreference` by name.
/// Absent is automatic.
pub download_source: Option<String>,
diff --git a/src/crates/concat/ui/app.slint b/src/crates/concat/ui/app.slint
index 7d64995e..1b8e5777 100644
--- a/src/crates/concat/ui/app.slint
+++ b/src/crates/concat/ui/app.slint
@@ -223,7 +223,6 @@ export component App inherits Window {
callback settings-playhead-reset();
callback settings-playhead-stops-changed(on: bool);
callback settings-magnetic-changed(on: bool);
- callback settings-speech-accelerated-changed(on: bool);
callback settings-download-source-changed(index: int);
callback settings-download-base-edited(text: string);
callback settings-server-enabled-changed(on: bool);
@@ -580,7 +579,6 @@ export component App inherits Window {
playhead-reset => { root.settings-playhead-reset(); }
playhead-stops-changed(on) => { root.settings-playhead-stops-changed(on); }
magnetic-changed(on) => { root.settings-magnetic-changed(on); }
- speech-accelerated-changed(on) => { root.settings-speech-accelerated-changed(on); }
download-source-changed(index) => { root.settings-download-source-changed(index); }
download-base-edited(text) => { root.settings-download-base-edited(text); }
server-enabled-changed(on) => { root.settings-server-enabled-changed(on); }
diff --git a/src/crates/concat/ui/dialogs/settings.slint b/src/crates/concat/ui/dialogs/settings.slint
index 6639707e..3616fce7 100644
--- a/src/crates/concat/ui/dialogs/settings.slint
+++ b/src/crates/concat/ui/dialogs/settings.slint
@@ -54,11 +54,6 @@ export struct SettingsData {
playhead-stops: bool,
/// the magnetic timeline: deleting and trimming close the gap
magnetic: bool,
- /// the voices run on the machine's accelerator rather than the CPU
- speech-accelerated: bool,
- /// this build has an accelerator to offer the voices; off, the switch
- /// is not shown
- speech-acceleration-offered: bool,
/// where model downloads look first: automatic, Concat's mirror,
/// hf-mirror.com, the original source, a custom URL
download-source: int,
@@ -428,7 +423,6 @@ export component SettingsDialog inherits Modal {
callback playhead-reset();
callback playhead-stops-changed(on: bool);
callback magnetic-changed(on: bool);
- callback speech-accelerated-changed(on: bool);
callback download-source-changed(index: int);
callback download-base-edited(text: string);
callback server-enabled-changed(on: bool);
@@ -855,19 +849,6 @@ export component SettingsDialog inherits Modal {
remove => { root.model-remove(model.id); }
}
}
-
- // The machine's own accelerator, where the build has one.
- // A bet rather than a default: CoreML takes the parts of a
- // network it knows and hands the rest to the CPU, so how
- // much faster a read gets is the model's business.
- if root.data.speech-acceleration-offered: DialogSection {
- title: I18n.t("Engine");
- hint: I18n.t("On, the voices run on this Mac's GPU and Neural Engine through CoreML wherever the model allows, and on the CPU where it does not. Off, everything runs on the CPU. Takes effect on the next read; a model already loaded is loaded again.");
- switchable: true;
- on: root.data.speech-accelerated;
- open: false;
- switched(on) => { root.speech-accelerated-changed(on); }
- }
}
// The API on a socket. The switch is the whole of it for most