Skip to content

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

feat(library): an Audio page with the user's own sounds, kept across projects (#60)

Jareerf7380346b157
diff --git a/src/crates/concat-host/src/dirs.rs b/src/crates/concat-host/src/dirs.rs
index 8e9b3b70..fecc210f 100644
--- a/src/crates/concat-host/src/dirs.rs
+++ b/src/crates/concat-host/src/dirs.rs
@@ -86,11 +86,24 @@ impl AppDirs {
data: root.to_path_buf(),
}
}
+
+ /// Where what the user made and cannot download again is kept - the
+ /// Audio page's own sounds, the voices they cloned: `data` everywhere
+ /// but an iPhone, whose `data` is `Caches`, which the phone may empty
+ /// when it runs short of space and does not back up. There it is
+ /// `config`, `Application Support`, which it keeps.
+ pub fn library(&self) -> PathBuf {
+ if cfg!(target_os = "ios") {
+ self.config.clone()
+ } else {
+ self.data.clone()
+ }
+ }
}
/// The folders under `data`, each named where it is made: models, caches
/// and logs. What is not listed is the settings', and stays in `config`.
-const DATA_FOLDERS: [&str; 7] = [
+const DATA_FOLDERS: [&str; 8] = [
"cutout-models", // concat-vision, models.rs
"whisper-models", // concat-speech, transcribe.rs
"tts-models", // concat-speech, tts.rs
@@ -98,6 +111,7 @@ const DATA_FOLDERS: [&str; 7] = [
"titles", // titles.rs
"updates", // updates.rs
"logs", // logs.rs
+ "audio", // sounds.rs: the Audio page's own sounds; see `library`
];
/// Moves what an older build kept under `from` - Windows kept models and
diff --git a/src/crates/concat-host/src/lib.rs b/src/crates/concat-host/src/lib.rs
index f7571854..4ba18585 100644
--- a/src/crates/concat-host/src/lib.rs
+++ b/src/crates/concat-host/src/lib.rs
@@ -41,6 +41,7 @@ pub mod proxy;
pub mod record;
pub mod reverse;
pub mod session;
+pub mod sounds;
pub mod stabilize;
pub mod templates;
pub mod titles;
diff --git a/src/crates/concat-host/src/sounds.rs b/src/crates/concat-host/src/sounds.rs
new file mode 100644
index 00000000..05a34848
--- /dev/null
+++ b/src/crates/concat-host/src/sounds.rs
@@ -0,0 +1,356 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors
+
+//! The user's own sound library: the Audio page's Mine shelf.
+//!
+//! A sound brought in here is copied into `<library>/audio/` (see
+//! [`AppDirs::library`]), so it is there in every project and survives the
+//! original being moved or deleted. Beside the copies is `library.json`,
+//! the index: each sound's name, its file, how long it is and a small
+//! envelope of it - sixty-four bars, read once at import - so the shelf
+//! draws every card without decoding anything when it opens.
+//!
+//! Nothing here touches a project. A sound put on the timeline is copied
+//! again into that project's own folder by the window, so a project never
+//! points into the library and removing a sound from it breaks nothing.
+
+use std::path::{Path, PathBuf};
+
+use serde::{Deserialize, Serialize};
+
+use crate::AppDirs;
+
+/// How many bars a card's envelope has.
+pub const BARS: usize = 64;
+
+/// The extensions the library takes: sound files, the way the bin's
+/// import names them. A video's soundtrack is not a library sound.
+pub const EXTENSIONS: [&str; 9] = ["mp3", "wav", "aac", "m4a", "flac", "ogg", "opus", "aif", "aiff"];
+
+/// One sound in the library.
+#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
+#[serde(rename_all = "camelCase")]
+pub struct Sound {
+ /// Stable for as long as the sound is in the library; what a drag
+ /// carries and what the index is keyed by.
+ pub id: String,
+ /// What the card says: the file's name without its extension, at
+ /// first.
+ pub name: String,
+ /// The copy's file name inside the library folder.
+ pub file: String,
+ /// Seconds.
+ pub duration: f64,
+ /// A shelf of the user's choosing; empty for none. Kept for the day
+ /// the shelf offers categories of one's own.
+ #[serde(default)]
+ pub category: String,
+ /// The envelope: [`BARS`] peaks, each `0..=1`, quantised to hundredths.
+ #[serde(default)]
+ pub bars: Vec<f32>,
+ /// When it came in, as Unix seconds: the shelf's order, newest first.
+ #[serde(default)]
+ pub added: u64,
+}
+
+/// The index on disk.
+#[derive(Serialize, Deserialize, Default)]
+struct Index {
+ #[serde(default)]
+ sounds: Vec<Sound>,
+}
+
+/// The library: its folder and what is in it.
+#[derive(Clone, Debug, Default)]
+pub struct Library {
+ /// The folder: the copies and the index beside them.
+ pub dir: PathBuf,
+ /// Newest first.
+ pub sounds: Vec<Sound>,
+}
+
+impl Library {
+ /// Where the library lives on this machine.
+ pub fn dir_in(dirs: &AppDirs) -> PathBuf {
+ dirs.library().join("audio")
+ }
+
+ /// The library as the index has it. A missing or unreadable index is
+ /// an empty library, and a sound whose copy has gone is left out.
+ pub fn open(dirs: &AppDirs) -> Library {
+ Library::at(Self::dir_in(dirs))
+ }
+
+ /// The library in `dir`; see [`Library::open`].
+ pub fn at(dir: PathBuf) -> Library {
+ let index: Index = std::fs::read(dir.join("library.json"))
+ .ok()
+ .and_then(|bytes| serde_json::from_slice(&bytes).ok())
+ .unwrap_or_default();
+ let sounds = index
+ .sounds
+ .into_iter()
+ .filter(|sound| is_plain_name(&sound.file) && dir.join(&sound.file).is_file())
+ .collect();
+ Library { dir, sounds }
+ }
+
+ /// The copy of `sound` on disk.
+ pub fn path_of(&self, sound: &Sound) -> PathBuf {
+ self.dir.join(&sound.file)
+ }
+
+ /// The sound by its id.
+ pub fn get(&self, id: &str) -> Option<&Sound> {
+ self.sounds.iter().find(|sound| sound.id == id)
+ }
+
+ /// Writes the index, through a temporary file and a rename, so a crash
+ /// mid-write leaves the last one whole.
+ fn save(&self) -> Result<(), String> {
+ std::fs::create_dir_all(&self.dir)
+ .map_err(|error| format!("could not create {}: {error}", self.dir.display()))?;
+ let index = Index {
+ sounds: self.sounds.clone(),
+ };
+ let bytes = serde_json::to_vec_pretty(&index).map_err(|error| error.to_string())?;
+ let path = self.dir.join("library.json");
+ let partial = self.dir.join("library.json.partial");
+ std::fs::write(&partial, bytes)
+ .and_then(|()| std::fs::rename(&partial, &path))
+ .map_err(|error| format!("could not write {}: {error}", path.display()))
+ }
+
+ /// Takes in a sound [`prepare`] made, and writes the index.
+ pub fn add(&mut self, sound: Sound) -> Result<(), String> {
+ self.sounds.retain(|held| held.id != sound.id);
+ self.sounds.insert(0, sound);
+ self.save()
+ }
+
+ /// Deletes the copy and forgets the sound. A copy already gone is not
+ /// an error: what the person asked for is that it be gone.
+ pub fn remove(&mut self, id: &str) -> Result<(), String> {
+ let Some(at) = self.sounds.iter().position(|sound| sound.id == id) else {
+ return Ok(());
+ };
+ let sound = self.sounds.remove(at);
+ let path = self.path_of(&sound);
+ if let Err(error) = std::fs::remove_file(&path)
+ && error.kind() != std::io::ErrorKind::NotFound
+ {
+ self.sounds.insert(at, sound);
+ return Err(format!("could not delete {}: {error}", path.display()));
+ }
+ self.save()
+ }
+}
+
+/// Whether a path is a sound the library takes, by its extension.
+pub fn is_sound(path: &Path) -> bool {
+ path.extension()
+ .and_then(|extension| extension.to_str())
+ .is_some_and(|extension| {
+ EXTENSIONS
+ .iter()
+ .any(|known| known.eq_ignore_ascii_case(extension))
+ })
+}
+
+/// A file name with nothing in it that could walk out of a folder.
+fn is_plain_name(name: &str) -> bool {
+ !name.is_empty()
+ && name != "."
+ && name != ".."
+ && !name.contains(['/', '\\', ':'])
+ && Path::new(name).file_name().is_some_and(|file| file == name)
+}
+
+/// Copies `source` into the library folder `dir` and reads what its card
+/// needs: how long it is, and its envelope. Slow - a decode of the whole
+/// file - so a worker's; [`Library::add`] then takes the result in on the
+/// window's thread.
+///
+/// The copy keeps the file's own name, numbered when the folder already
+/// has one by it, and a file that is not sound is refused before anything
+/// is copied.
+pub fn prepare(dir: &Path, source: &Path) -> Result<Sound, String> {
+ if !is_sound(source) {
+ return Err(format!("{} is not a sound file", source.display()));
+ }
+ let summary = crate::media::probe(&source.to_string_lossy())?;
+ if summary.audio.is_none() {
+ return Err(format!("{} has no sound in it", source.display()));
+ }
+ std::fs::create_dir_all(dir)
+ .map_err(|error| format!("could not create {}: {error}", dir.display()))?;
+ let stem = source
+ .file_stem()
+ .map(|stem| stem.to_string_lossy().into_owned())
+ .unwrap_or_else(|| "Sound".to_owned());
+ let extension = source
+ .extension()
+ .map(|extension| extension.to_string_lossy().to_ascii_lowercase())
+ .unwrap_or_default();
+ let file = free_name(dir, &stem, &extension);
+ let target = dir.join(&file);
+ std::fs::copy(source, &target)
+ .map_err(|error| format!("could not copy {}: {error}", source.display()))?;
+ let duration = summary.duration.unwrap_or(0.0);
+ let bars = envelope(&target, duration).unwrap_or_default();
+ let added = now();
+ Ok(Sound {
+ id: format!(
+ "{:012x}",
+ crate::media::fnv1a(format!("{file}|{added}").as_bytes()) & 0xffff_ffff_ffff
+ ),
+ name: stem,
+ file,
+ duration,
+ category: String::new(),
+ bars,
+ added,
+ })
+}
+
+/// `stem.extension` in `dir`, or `stem 2.extension` and on, whichever is
+/// free, with anything that could not be a plain file name taken out.
+fn free_name(dir: &Path, stem: &str, extension: &str) -> String {
+ let clean: String = stem
+ .chars()
+ .map(|c| {
+ if c.is_control() || matches!(c, '/' | '\\' | ':' | '*' | '?' | '"' | '<' | '>' | '|') {
+ '_'
+ } else {
+ c
+ }
+ })
+ .collect();
+ let clean = clean.trim().trim_matches('.');
+ let clean = if clean.is_empty() { "Sound" } else { clean };
+ let named = |n: u32| {
+ let stem = if n == 1 {
+ clean.to_owned()
+ } else {
+ format!("{clean} {n}")
+ };
+ if extension.is_empty() {
+ stem
+ } else {
+ format!("{stem}.{extension}")
+ }
+ };
+ (1..)
+ .map(named)
+ .find(|name| name != "library.json" && !dir.join(name).exists())
+ .unwrap_or_else(|| "Sound".to_owned())
+}
+
+/// The envelope a card draws: [`BARS`] peaks across the whole file.
+pub fn envelope(path: &Path, duration: f64) -> Option<Vec<f32>> {
+ // A hundred buckets a second is plenty for sixty-four bars, and a
+ // tenth of the work of the timeline's resolution.
+ let peaks = concat_media::peaks::extract(path, 100, None).ok()?;
+ let span = if duration > 0.0 {
+ duration as f32
+ } else {
+ peaks.len() as f32 / peaks.buckets_per_second.max(1.0)
+ };
+ if span <= 0.0 {
+ return None;
+ }
+ let pitch = span / BARS as f32;
+ Some(
+ (0..BARS)
+ .map(|bar| {
+ let (low, high) = peaks.extremes(bar as f32 * pitch, (bar + 1) as f32 * pitch);
+ (high.max(-low).clamp(0.0, 1.0) * 100.0).round() / 100.0
+ })
+ .collect(),
+ )
+}
+
+fn now() -> u64 {
+ std::time::SystemTime::now()
+ .duration_since(std::time::UNIX_EPOCH)
+ .map_or(0, |since| since.as_secs())
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ fn scratch(name: &str) -> PathBuf {
+ let dir = std::env::temp_dir().join(format!("concat-sounds-{name}-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir_all(&dir).unwrap();
+ dir
+ }
+
+ #[test]
+ fn a_name_is_numbered_rather_than_overwritten() {
+ let dir = scratch("names");
+ assert_eq!(free_name(&dir, "Whoosh", "wav"), "Whoosh.wav");
+ std::fs::write(dir.join("Whoosh.wav"), b"x").unwrap();
+ assert_eq!(free_name(&dir, "Whoosh", "wav"), "Whoosh 2.wav");
+ assert_eq!(free_name(&dir, "../up", "wav"), "_up.wav");
+ assert_eq!(free_name(&dir, " ", "mp3"), "Sound.mp3");
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+
+ #[test]
+ fn only_sound_files_are_taken() {
+ assert!(is_sound(Path::new("/a/Rain.WAV")));
+ assert!(is_sound(Path::new("b.m4a")));
+ assert!(!is_sound(Path::new("clip.mp4")));
+ assert!(!is_sound(Path::new("noextension")));
+ }
+
+ /// The index keeps what is added, newest first, survives a reopen, and
+ /// forgets a sound whose copy has gone; a removal deletes the copy.
+ #[test]
+ fn the_index_round_trips_and_a_removal_deletes_the_copy() {
+ let dir = scratch("index");
+ let mut library = Library::at(dir.clone());
+ assert!(library.sounds.is_empty());
+ for (id, file) in [("a", "One.wav"), ("b", "Two.wav")] {
+ std::fs::write(dir.join(file), b"riff").unwrap();
+ library
+ .add(Sound {
+ id: id.into(),
+ name: file.trim_end_matches(".wav").into(),
+ file: file.into(),
+ duration: 1.5,
+ category: String::new(),
+ bars: vec![0.5; BARS],
+ added: 1,
+ })
+ .unwrap();
+ }
+ let reopened = Library::at(dir.clone());
+ assert_eq!(
+ reopened.sounds.iter().map(|s| s.id.as_str()).collect::<Vec<_>>(),
+ ["b", "a"]
+ );
+ assert_eq!(reopened.get("a").unwrap().bars.len(), BARS);
+
+ library.remove("b").unwrap();
+ assert!(!dir.join("Two.wav").exists());
+ std::fs::remove_file(dir.join("One.wav")).unwrap();
+ assert!(Library::at(dir.clone()).sounds.is_empty(), "a missing copy is left out");
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+
+ /// An index that names a file outside the folder is not believed.
+ #[test]
+ fn an_index_cannot_point_out_of_the_folder() {
+ let dir = scratch("escape");
+ std::fs::write(
+ dir.join("library.json"),
+ br#"{"sounds":[{"id":"x","name":"x","file":"../x.wav","duration":1}]}"#,
+ )
+ .unwrap();
+ assert!(Library::at(dir.clone()).sounds.is_empty());
+ let _ = std::fs::remove_dir_all(&dir);
+ }
+}
diff --git a/src/crates/concat/locales/ar.json b/src/crates/concat/locales/ar.json
index 202dea77..8c22a623 100644
--- a/src/crates/concat/locales/ar.json
+++ b/src/crates/concat/locales/ar.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "إطار واحد للخلف",
"shortcuts.stepForward": "إطار واحد للأمام",
"shortcuts.unboundNow": "أصبح {0} بلا مفتاح الآن",
+ "sounds.addedMany": "أُضيف {0} أصوات إلى مكتبتك",
+ "sounds.addedOne": "أُضيف صوت إلى مكتبتك",
+ "sounds.couldNotCopy": "تعذّر نسخ {0} إلى المشروع: {1}",
+ "sounds.importSounds": "استيراد أصوات",
+ "sounds.mine": "أصواتي",
+ "sounds.mineHint": "انقر على صوت لتسمعه، واضغط + لإضافته عند رأس التشغيل، أو اسحبه إلى المخطط الزمني. أصواتك موجودة هنا في كل مشروع.",
+ "sounds.mineHintPhone": "اضغط على صوت لتسمعه، و+ لإضافته عند رأس التشغيل. أصواتك موجودة هنا في كل مشروع.",
+ "sounds.noSoundsYet": "لا توجد أصوات خاصة بك بعد. استورد ملفات صوتية وستبقى في مكتبتك، جاهزة لكل مشروع.",
+ "sounds.notASound": "{0} ليس ملفًا صوتيًا",
+ "sounds.openProjectFirst": "افتح مشروعًا أولًا",
+ "sounds.removed": "أُزيل {0} من مكتبتك",
+ "sounds.sounds": "الأصوات",
"speech.aboutInCharacters": "نحو {0}:{1} بصوت {2} · {3} حرفًا",
"speech.american": "أمريكي",
"speech.anyVoiceRecording": "أي صوت، من تسجيل",
diff --git a/src/crates/concat/locales/bn.json b/src/crates/concat/locales/bn.json
index c951c796..ff852cb4 100644
--- a/src/crates/concat/locales/bn.json
+++ b/src/crates/concat/locales/bn.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "এক ফ্রেম পিছনে",
"shortcuts.stepForward": "এক ফ্রেম সামনে",
"shortcuts.unboundNow": "{0}-এর এখন কোনো কী নেই",
+ "sounds.addedMany": "আপনার লাইব্রেরিতে {0}টি সাউন্ড যোগ হয়েছে",
+ "sounds.addedOne": "আপনার লাইব্রেরিতে একটি সাউন্ড যোগ হয়েছে",
+ "sounds.couldNotCopy": "{0} প্রজেক্টে কপি করা যায়নি: {1}",
+ "sounds.importSounds": "সাউন্ড ইমপোর্ট করুন",
+ "sounds.mine": "আমার সাউন্ড",
+ "sounds.mineHint": "শুনতে একটি সাউন্ডে ক্লিক করুন, প্লেহেডে যোগ করতে + চাপুন, বা টাইমলাইনে টেনে আনুন। আপনার সাউন্ডগুলো প্রতিটি প্রজেক্টে এখানে থাকে।",
+ "sounds.mineHintPhone": "শুনতে একটি সাউন্ডে ট্যাপ করুন, আর প্লেহেডে যোগ করতে +। আপনার সাউন্ডগুলো প্রতিটি প্রজেক্টে এখানে থাকে।",
+ "sounds.noSoundsYet": "এখনও আপনার নিজের কোনো সাউন্ড নেই। সাউন্ড ফাইল ইমপোর্ট করুন, সেগুলো আপনার লাইব্রেরিতে থাকবে, প্রতিটি প্রজেক্টের জন্য প্রস্তুত।",
+ "sounds.notASound": "{0} কোনো সাউন্ড ফাইল নয়",
+ "sounds.openProjectFirst": "আগে একটি প্রজেক্ট খুলুন",
+ "sounds.removed": "আপনার লাইব্রেরি থেকে {0} সরানো হয়েছে",
+ "sounds.sounds": "সাউন্ড",
"speech.aboutInCharacters": "প্রায় {0}:{1} · {2} · {3} অক্ষর",
"speech.american": "আমেরিকান",
"speech.anyVoiceRecording": "রেকর্ডিং থেকে যেকোনো কণ্ঠ",
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.json
index 2802eb31..aaf6b2bb 100644
--- a/src/crates/concat/locales/de.json
+++ b/src/crates/concat/locales/de.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Ein Bild zurück",
"shortcuts.stepForward": "Ein Bild vor",
"shortcuts.unboundNow": "{0} ist jetzt nicht belegt",
+ "sounds.addedMany": "{0} Sounds wurden deiner Bibliothek hinzugefügt",
+ "sounds.addedOne": "Ein Sound wurde deiner Bibliothek hinzugefügt",
+ "sounds.couldNotCopy": "{0} konnte nicht ins Projekt kopiert werden: {1}",
+ "sounds.importSounds": "Sounds importieren",
+ "sounds.mine": "Meine Sounds",
+ "sounds.mineHint": "Klicke auf einen Sound, um ihn zu hören, drücke +, um ihn am Abspielkopf einzufügen, oder zieh ihn auf die Zeitleiste. Deine Sounds sind in jedem Projekt hier.",
+ "sounds.mineHintPhone": "Tippe auf einen Sound, um ihn zu hören, und auf +, um ihn am Abspielkopf einzufügen. Deine Sounds sind in jedem Projekt hier.",
+ "sounds.noSoundsYet": "Noch keine eigenen Sounds. Importiere Audiodateien, dann bleiben sie in deiner Bibliothek, bereit für jedes Projekt.",
+ "sounds.notASound": "{0} ist keine Audiodatei",
+ "sounds.openProjectFirst": "Öffne zuerst ein Projekt",
+ "sounds.removed": "{0} wurde aus deiner Bibliothek entfernt",
+ "sounds.sounds": "Sounds",
"speech.aboutInCharacters": "Etwa {0}:{1} in {2} · {3} Zeichen",
"speech.american": "Amerikanisch",
"speech.anyVoiceRecording": "Jede Stimme, aus einer Aufnahme",
diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.json
index 28429469..2c9a26c1 100644
--- a/src/crates/concat/locales/en.json
+++ b/src/crates/concat/locales/en.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Step back a frame",
"shortcuts.stepForward": "Step forward a frame",
"shortcuts.unboundNow": "{0} is unbound now",
+ "sounds.addedMany": "Added {0} sounds to your library",
+ "sounds.addedOne": "Added a sound to your library",
+ "sounds.couldNotCopy": "Could not copy {0} into the project: {1}",
+ "sounds.importSounds": "Import sounds",
+ "sounds.mine": "My sounds",
+ "sounds.mineHint": "Click a sound to hear it, press + to add it at the playhead, or drag it onto the timeline. Your sounds are here in every project.",
+ "sounds.mineHintPhone": "Tap a sound to hear it, and + to add it at the playhead. Your sounds are here in every project.",
+ "sounds.noSoundsYet": "No sounds of your own yet. Import sound files and they stay in your library, ready for every project.",
+ "sounds.notASound": "{0} is not a sound file",
+ "sounds.openProjectFirst": "Open a project first",
+ "sounds.removed": "Removed {0} from your library",
+ "sounds.sounds": "Sounds",
"speech.aboutInCharacters": "About {0}:{1} in {2} · {3} characters",
"speech.american": "American",
"speech.anyVoiceRecording": "Any voice, from a recording",
diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.json
index 3c0829c6..9fe06548 100644
--- a/src/crates/concat/locales/es.json
+++ b/src/crates/concat/locales/es.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Retroceder un fotograma",
"shortcuts.stepForward": "Avanzar un fotograma",
"shortcuts.unboundNow": "{0} ya no tiene tecla",
+ "sounds.addedMany": "Se añadieron {0} sonidos a tu biblioteca",
+ "sounds.addedOne": "Se añadió un sonido a tu biblioteca",
+ "sounds.couldNotCopy": "No se pudo copiar {0} al proyecto: {1}",
+ "sounds.importSounds": "Importar sonidos",
+ "sounds.mine": "Mis sonidos",
+ "sounds.mineHint": "Haz clic en un sonido para oírlo, pulsa + para añadirlo en el cabezal o arrástralo a la línea de tiempo. Tus sonidos están aquí en todos los proyectos.",
+ "sounds.mineHintPhone": "Toca un sonido para oírlo y + para añadirlo en el cabezal. Tus sonidos están aquí en todos los proyectos.",
+ "sounds.noSoundsYet": "Todavía no tienes sonidos propios. Importa archivos de sonido y se quedarán en tu biblioteca, listos para cada proyecto.",
+ "sounds.notASound": "{0} no es un archivo de sonido",
+ "sounds.openProjectFirst": "Abre primero un proyecto",
+ "sounds.removed": "Se quitó {0} de tu biblioteca",
+ "sounds.sounds": "Sonidos",
"speech.aboutInCharacters": "Unos {0}:{1} en {2} · {3} caracteres",
"speech.american": "Americano",
"speech.anyVoiceRecording": "Cualquier voz, a partir de una grabación",
diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.json
index 90654acc..413038e5 100644
--- a/src/crates/concat/locales/fa.json
+++ b/src/crates/concat/locales/fa.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "یک فریم به عقب",
"shortcuts.stepForward": "یک فریم به جلو",
"shortcuts.unboundNow": "{0} اکنون بدون کلید است",
+ "sounds.addedMany": "{0} صدا به کتابخانه‌تان اضافه شد",
+ "sounds.addedOne": "یک صدا به کتابخانه‌تان اضافه شد",
+ "sounds.couldNotCopy": "کپی {0} در پروژه ممکن نشد: {1}",
+ "sounds.importSounds": "وارد کردن صدا",
+ "sounds.mine": "صداهای من",
+ "sounds.mineHint": "روی یک صدا کلیک کنید تا آن را بشنوید، + را بزنید تا در محل نشانگر پخش اضافه شود، یا آن را به خط زمان بکشید. صداهای شما در هر پروژه اینجا هستند.",
+ "sounds.mineHintPhone": "روی یک صدا بزنید تا آن را بشنوید، و + را تا در محل نشانگر پخش اضافه شود. صداهای شما در هر پروژه اینجا هستند.",
+ "sounds.noSoundsYet": "هنوز صدایی از خودتان ندارید. فایل‌های صوتی را وارد کنید تا در کتابخانه‌تان بمانند و برای هر پروژه آماده باشند.",
+ "sounds.notASound": "{0} یک فایل صوتی نیست",
+ "sounds.openProjectFirst": "ابتدا یک پروژه باز کنید",
+ "sounds.removed": "{0} از کتابخانه‌تان حذف شد",
+ "sounds.sounds": "صداها",
"speech.aboutInCharacters": "حدود {0}:{1} در {2} · {3} کاراکتر",
"speech.american": "آمریکایی",
"speech.anyVoiceRecording": "هر صدایی، از یک ضبط",
diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.json
index cd92b0af..41b3773b 100644
--- a/src/crates/concat/locales/fr.json
+++ b/src/crates/concat/locales/fr.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Reculer d'une image",
"shortcuts.stepForward": "Avancer d'une image",
"shortcuts.unboundNow": "{0} n'a plus de touche",
+ "sounds.addedMany": "{0} sons ont été ajoutés à votre bibliothèque",
+ "sounds.addedOne": "Un son a été ajouté à votre bibliothèque",
+ "sounds.couldNotCopy": "Impossible de copier {0} dans le projet : {1}",
+ "sounds.importSounds": "Importer des sons",
+ "sounds.mine": "Mes sons",
+ "sounds.mineHint": "Cliquez sur un son pour l’écouter, appuyez sur + pour l’ajouter à la tête de lecture ou faites-le glisser sur la timeline. Vos sons sont là dans chaque projet.",
+ "sounds.mineHintPhone": "Touchez un son pour l’écouter, et + pour l’ajouter à la tête de lecture. Vos sons sont là dans chaque projet.",
+ "sounds.noSoundsYet": "Pas encore de sons à vous. Importez des fichiers audio : ils restent dans votre bibliothèque, prêts pour chaque projet.",
+ "sounds.notASound": "{0} n’est pas un fichier audio",
+ "sounds.openProjectFirst": "Ouvrez d’abord un projet",
+ "sounds.removed": "{0} a été retiré de votre bibliothèque",
+ "sounds.sounds": "Sons",
"speech.aboutInCharacters": "Environ {0}:{1} en {2} · {3} caractères",
"speech.american": "Américain",
"speech.anyVoiceRecording": "N'importe quelle voix, à partir d'un enregistrement",
diff --git a/src/crates/concat/locales/he.json b/src/crates/concat/locales/he.json
index 6931a11c..c30e98e2 100644
--- a/src/crates/concat/locales/he.json
+++ b/src/crates/concat/locales/he.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "פריים אחד אחורה",
"shortcuts.stepForward": "פריים אחד קדימה",
"shortcuts.unboundNow": "{0} נשאר עכשיו בלי מקש",
+ "sounds.addedMany": "{0} צלילים נוספו לספרייה שלכם",
+ "sounds.addedOne": "צליל נוסף לספרייה שלכם",
+ "sounds.couldNotCopy": "לא ניתן להעתיק את {0} לפרויקט: {1}",
+ "sounds.importSounds": "ייבוא צלילים",
+ "sounds.mine": "הצלילים שלי",
+ "sounds.mineHint": "לחצו על צליל כדי לשמוע אותו, על + כדי להוסיף אותו בראש הניגון, או גררו אותו לציר הזמן. הצלילים שלכם כאן בכל פרויקט.",
+ "sounds.mineHintPhone": "הקישו על צליל כדי לשמוע אותו, ועל + כדי להוסיף אותו בראש הניגון. הצלילים שלכם כאן בכל פרויקט.",
+ "sounds.noSoundsYet": "עדיין אין צלילים משלכם. ייבאו קובצי שמע והם יישארו בספרייה שלכם, מוכנים לכל פרויקט.",
+ "sounds.notASound": "{0} אינו קובץ שמע",
+ "sounds.openProjectFirst": "פתחו קודם פרויקט",
+ "sounds.removed": "{0} הוסר מהספרייה שלכם",
+ "sounds.sounds": "צלילים",
"speech.aboutInCharacters": "כ-{0}:{1} בקול {2} · {3} תווים",
"speech.american": "אמריקאי",
"speech.anyVoiceRecording": "כל קול, מתוך הקלטה",
diff --git a/src/crates/concat/locales/hi.json b/src/crates/concat/locales/hi.json
index 723f4a98..f4c90f34 100644
--- a/src/crates/concat/locales/hi.json
+++ b/src/crates/concat/locales/hi.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "एक फ़्रेम पीछे",
"shortcuts.stepForward": "एक फ़्रेम आगे",
"shortcuts.unboundNow": "{0} की अब कोई कुंजी नहीं है",
+ "sounds.addedMany": "आपकी लाइब्रेरी में {0} साउंड जोड़े गए",
+ "sounds.addedOne": "आपकी लाइब्रेरी में एक साउंड जोड़ा गया",
+ "sounds.couldNotCopy": "{0} को प्रोजेक्ट में कॉपी नहीं किया जा सका: {1}",
+ "sounds.importSounds": "साउंड इम्पोर्ट करें",
+ "sounds.mine": "मेरे साउंड",
+ "sounds.mineHint": "सुनने के लिए किसी साउंड पर क्लिक करें, प्लेहेड पर जोड़ने के लिए + दबाएँ, या उसे टाइमलाइन पर खींचें। आपके साउंड हर प्रोजेक्ट में यहाँ मिलेंगे।",
+ "sounds.mineHintPhone": "सुनने के लिए किसी साउंड पर टैप करें, और प्लेहेड पर जोड़ने के लिए +। आपके साउंड हर प्रोजेक्ट में यहाँ मिलेंगे।",
+ "sounds.noSoundsYet": "अभी आपका कोई अपना साउंड नहीं है। साउंड फ़ाइलें इम्पोर्ट करें, वे आपकी लाइब्रेरी में रहेंगी, हर प्रोजेक्ट के लिए तैयार।",
+ "sounds.notASound": "{0} कोई साउंड फ़ाइल नहीं है",
+ "sounds.openProjectFirst": "पहले कोई प्रोजेक्ट खोलें",
+ "sounds.removed": "आपकी लाइब्रेरी से {0} हटाया गया",
+ "sounds.sounds": "साउंड",
"speech.aboutInCharacters": "लगभग {0}:{1}, {2} की आवाज़ में · {3} अक्षर",
"speech.american": "अमेरिकी",
"speech.anyVoiceRecording": "कोई भी आवाज़, रिकॉर्डिंग से",
diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.json
index 6b189adc..63d546d3 100644
--- a/src/crates/concat/locales/hr.json
+++ b/src/crates/concat/locales/hr.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Natrag jedan kadar",
"shortcuts.stepForward": "Naprijed jedan kadar",
"shortcuts.unboundNow": "{0} više nema tipku",
+ "sounds.addedMany": "Dodano je {0} zvukova u vašu knjižnicu",
+ "sounds.addedOne": "Zvuk je dodan u vašu knjižnicu",
+ "sounds.couldNotCopy": "{0} nije moguće kopirati u projekt: {1}",
+ "sounds.importSounds": "Uvezi zvukove",
+ "sounds.mine": "Moji zvukovi",
+ "sounds.mineHint": "Kliknite zvuk da ga čujete, pritisnite + da ga dodate na glavu za reprodukciju ili ga povucite na vremensku crtu. Vaši su zvukovi ovdje u svakom projektu.",
+ "sounds.mineHintPhone": "Dodirnite zvuk da ga čujete, a + da ga dodate na glavu za reprodukciju. Vaši su zvukovi ovdje u svakom projektu.",
+ "sounds.noSoundsYet": "Još nemate vlastitih zvukova. Uvezite zvučne datoteke i ostat će u vašoj knjižnici, spremne za svaki projekt.",
+ "sounds.notASound": "{0} nije zvučna datoteka",
+ "sounds.openProjectFirst": "Najprije otvorite projekt",
+ "sounds.removed": "{0} uklonjen je iz vaše knjižnice",
+ "sounds.sounds": "Zvukovi",
"speech.aboutInCharacters": "Oko {0}:{1} u {2} · {3} znakova",
"speech.american": "američki",
"speech.anyVoiceRecording": "Bilo koji glas, iz snimke",
diff --git a/src/crates/concat/locales/id.json b/src/crates/concat/locales/id.json
index 52cca980..d4eecf01 100644
--- a/src/crates/concat/locales/id.json
+++ b/src/crates/concat/locales/id.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Mundur satu bingkai",
"shortcuts.stepForward": "Maju satu bingkai",
"shortcuts.unboundNow": "{0} kini tidak punya tombol",
+ "sounds.addedMany": "{0} suara ditambahkan ke pustakamu",
+ "sounds.addedOne": "Satu suara ditambahkan ke pustakamu",
+ "sounds.couldNotCopy": "Tidak dapat menyalin {0} ke proyek: {1}",
+ "sounds.importSounds": "Impor suara",
+ "sounds.mine": "Suaraku",
+ "sounds.mineHint": "Klik suara untuk mendengarnya, tekan + untuk menambahkannya di playhead, atau seret ke timeline. Suaramu ada di sini di setiap proyek.",
+ "sounds.mineHintPhone": "Ketuk suara untuk mendengarnya, dan + untuk menambahkannya di playhead. Suaramu ada di sini di setiap proyek.",
+ "sounds.noSoundsYet": "Belum ada suara milikmu. Impor file suara dan semuanya tetap di pustakamu, siap untuk setiap proyek.",
+ "sounds.notASound": "{0} bukan file suara",
+ "sounds.openProjectFirst": "Buka proyek terlebih dahulu",
+ "sounds.removed": "{0} dihapus dari pustakamu",
+ "sounds.sounds": "Suara",
"speech.aboutInCharacters": "Sekitar {0}:{1} dengan {2} · {3} karakter",
"speech.american": "Amerika",
"speech.anyVoiceRecording": "Suara apa pun, dari rekaman",
diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.json
index 7c818887..f53ad212 100644
--- a/src/crates/concat/locales/it.json
+++ b/src/crates/concat/locales/it.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Torna indietro di un fotogramma",
"shortcuts.stepForward": "Avanza di un fotogramma",
"shortcuts.unboundNow": "{0} non ha più un tasto",
+ "sounds.addedMany": "Aggiunti {0} suoni alla tua libreria",
+ "sounds.addedOne": "Aggiunto un suono alla tua libreria",
+ "sounds.couldNotCopy": "Impossibile copiare {0} nel progetto: {1}",
+ "sounds.importSounds": "Importa suoni",
+ "sounds.mine": "I miei suoni",
+ "sounds.mineHint": "Fai clic su un suono per ascoltarlo, premi + per aggiungerlo alla testina o trascinalo sulla timeline. I tuoi suoni sono qui in ogni progetto.",
+ "sounds.mineHintPhone": "Tocca un suono per ascoltarlo e + per aggiungerlo alla testina. I tuoi suoni sono qui in ogni progetto.",
+ "sounds.noSoundsYet": "Nessun suono tuo per ora. Importa file audio: resteranno nella tua libreria, pronti per ogni progetto.",
+ "sounds.notASound": "{0} non è un file audio",
+ "sounds.openProjectFirst": "Apri prima un progetto",
+ "sounds.removed": "{0} rimosso dalla tua libreria",
+ "sounds.sounds": "Suoni",
"speech.aboutInCharacters": "Circa {0}:{1} in {2} · {3} caratteri",
"speech.american": "Americano",
"speech.anyVoiceRecording": "Qualsiasi voce, da una registrazione",
diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.json
index 8192166b..b4b61e07 100644
--- a/src/crates/concat/locales/ja.json
+++ b/src/crates/concat/locales/ja.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "1フレーム戻る",
"shortcuts.stepForward": "1フレーム進む",
"shortcuts.unboundNow": "{0} は現在割り当てされていません",
+ "sounds.addedMany": "{0} 個のサウンドをライブラリに追加しました",
+ "sounds.addedOne": "サウンドをライブラリに追加しました",
+ "sounds.couldNotCopy": "{0} をプロジェクトにコピーできませんでした: {1}",
+ "sounds.importSounds": "サウンドを読み込む",
+ "sounds.mine": "マイサウンド",
+ "sounds.mineHint": "サウンドをクリックで試聴、+で再生ヘッドに追加、またはタイムラインへドラッグ。サウンドはどのプロジェクトでもここにあります。",
+ "sounds.mineHintPhone": "サウンドをタップで試聴、+で再生ヘッドに追加。サウンドはどのプロジェクトでもここにあります。",
+ "sounds.noSoundsYet": "自分のサウンドはまだありません。音声ファイルを読み込むとライブラリに保存され、どのプロジェクトでも使えます。",
+ "sounds.notASound": "{0} は音声ファイルではありません",
+ "sounds.openProjectFirst": "先にプロジェクトを開いてください",
+ "sounds.removed": "{0} をライブラリから削除しました",
+ "sounds.sounds": "サウンド",
"speech.aboutInCharacters": "約 {0}:{1} ({2}) · {3} 文字",
"speech.american": "アメリカ",
"speech.anyVoiceRecording": "録音から、どんな声でも",
diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.json
index 4255d2ff..57e52905 100644
--- a/src/crates/concat/locales/ko.json
+++ b/src/crates/concat/locales/ko.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "1프레임 뒤로",
"shortcuts.stepForward": "1프레임 앞으로",
"shortcuts.unboundNow": "{0}에 키가 없습니다",
+ "sounds.addedMany": "라이브러리에 사운드 {0}개를 추가했습니다",
+ "sounds.addedOne": "라이브러리에 사운드를 추가했습니다",
+ "sounds.couldNotCopy": "{0}을(를) 프로젝트로 복사할 수 없습니다: {1}",
+ "sounds.importSounds": "사운드 가져오기",
+ "sounds.mine": "내 사운드",
+ "sounds.mineHint": "사운드를 클릭하면 들을 수 있고, +를 누르면 재생 헤드에 추가되며, 타임라인으로 드래그할 수도 있습니다. 내 사운드는 모든 프로젝트에서 여기에 있습니다.",
+ "sounds.mineHintPhone": "사운드를 탭하면 들을 수 있고, +를 누르면 재생 헤드에 추가됩니다. 내 사운드는 모든 프로젝트에서 여기에 있습니다.",
+ "sounds.noSoundsYet": "아직 내 사운드가 없습니다. 사운드 파일을 가져오면 라이브러리에 남아 모든 프로젝트에서 쓸 수 있습니다.",
+ "sounds.notASound": "{0}은(는) 사운드 파일이 아닙니다",
+ "sounds.openProjectFirst": "먼저 프로젝트를 여세요",
+ "sounds.removed": "라이브러리에서 {0}을(를) 제거했습니다",
+ "sounds.sounds": "사운드",
"speech.aboutInCharacters": "약 {0}:{1} ({2}) · {3}자",
"speech.american": "미국식",
"speech.anyVoiceRecording": "녹음에서 딴 어떤 목소리든",
diff --git a/src/crates/concat/locales/nl.json b/src/crates/concat/locales/nl.json
index d5fa7479..be08e28d 100644
--- a/src/crates/concat/locales/nl.json
+++ b/src/crates/concat/locales/nl.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Eén frame terug",
"shortcuts.stepForward": "Eén frame vooruit",
"shortcuts.unboundNow": "{0} heeft nu geen toets",
+ "sounds.addedMany": "{0} geluiden aan je bibliotheek toegevoegd",
+ "sounds.addedOne": "Geluid aan je bibliotheek toegevoegd",
+ "sounds.couldNotCopy": "Kan {0} niet naar het project kopiëren: {1}",
+ "sounds.importSounds": "Geluiden importeren",
+ "sounds.mine": "Mijn geluiden",
+ "sounds.mineHint": "Klik op een geluid om het te horen, druk op + om het bij de afspeelkop toe te voegen, of sleep het naar de tijdlijn. Je geluiden staan hier in elk project.",
+ "sounds.mineHintPhone": "Tik op een geluid om het te horen, en op + om het bij de afspeelkop toe te voegen. Je geluiden staan hier in elk project.",
+ "sounds.noSoundsYet": "Nog geen eigen geluiden. Importeer geluidsbestanden en ze blijven in je bibliotheek, klaar voor elk project.",
+ "sounds.notASound": "{0} is geen geluidsbestand",
+ "sounds.openProjectFirst": "Open eerst een project",
+ "sounds.removed": "{0} uit je bibliotheek verwijderd",
+ "sounds.sounds": "Geluiden",
"speech.aboutInCharacters": "Ongeveer {0}:{1} met {2} · {3} tekens",
"speech.american": "Amerikaans",
"speech.anyVoiceRecording": "Elke stem, uit een opname",
diff --git a/src/crates/concat/locales/pl.json b/src/crates/concat/locales/pl.json
index d33c34da..2e1b0c89 100644
--- a/src/crates/concat/locales/pl.json
+++ b/src/crates/concat/locales/pl.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Klatka wstecz",
"shortcuts.stepForward": "Klatka naprzód",
"shortcuts.unboundNow": "{0} nie ma teraz klawisza",
+ "sounds.addedMany": "Dodano dźwięki do Twojej biblioteki: {0}",
+ "sounds.addedOne": "Dodano dźwięk do Twojej biblioteki",
+ "sounds.couldNotCopy": "Nie udało się skopiować {0} do projektu: {1}",
+ "sounds.importSounds": "Importuj dźwięki",
+ "sounds.mine": "Moje dźwięki",
+ "sounds.mineHint": "Kliknij dźwięk, aby go odsłuchać, naciśnij +, aby dodać go przy głowicy, albo przeciągnij go na oś czasu. Twoje dźwięki są tu w każdym projekcie.",
+ "sounds.mineHintPhone": "Stuknij dźwięk, aby go odsłuchać, a +, aby dodać go przy głowicy. Twoje dźwięki są tu w każdym projekcie.",
+ "sounds.noSoundsYet": "Nie masz jeszcze własnych dźwięków. Zaimportuj pliki dźwiękowe, a zostaną w Twojej bibliotece, gotowe do każdego projektu.",
+ "sounds.notASound": "{0} nie jest plikiem dźwiękowym",
+ "sounds.openProjectFirst": "Najpierw otwórz projekt",
+ "sounds.removed": "Usunięto {0} z Twojej biblioteki",
+ "sounds.sounds": "Dźwięki",
"speech.aboutInCharacters": "Około {0}:{1}, głos: {2} · znaki: {3}",
"speech.american": "amerykański",
"speech.anyVoiceRecording": "Dowolny głos z nagrania",
diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.json
index 77c67d99..fcc2e579 100644
--- a/src/crates/concat/locales/pt-BR.json
+++ b/src/crates/concat/locales/pt-BR.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Voltar um quadro",
"shortcuts.stepForward": "Avançar um quadro",
"shortcuts.unboundNow": "{0} não tem tecla agora",
+ "sounds.addedMany": "{0} sons foram adicionados à sua biblioteca",
+ "sounds.addedOne": "Um som foi adicionado à sua biblioteca",
+ "sounds.couldNotCopy": "Não foi possível copiar {0} para o projeto: {1}",
+ "sounds.importSounds": "Importar sons",
+ "sounds.mine": "Meus sons",
+ "sounds.mineHint": "Clique em um som para ouvi-lo, toque em + para adicioná-lo no cursor de reprodução ou arraste-o para a linha do tempo. Seus sons ficam aqui em todos os projetos.",
+ "sounds.mineHintPhone": "Toque em um som para ouvi-lo e em + para adicioná-lo no cursor de reprodução. Seus sons ficam aqui em todos os projetos.",
+ "sounds.noSoundsYet": "Ainda não há sons seus. Importe arquivos de som e eles ficam na sua biblioteca, prontos para todos os projetos.",
+ "sounds.notASound": "{0} não é um arquivo de som",
+ "sounds.openProjectFirst": "Abra um projeto primeiro",
+ "sounds.removed": "{0} foi removido da sua biblioteca",
+ "sounds.sounds": "Sons",
"speech.aboutInCharacters": "Cerca de {0}:{1} em {2} · {3} caracteres",
"speech.american": "Americano",
"speech.anyVoiceRecording": "Qualquer voz, a partir de uma gravação",
diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.json
index 29073c6c..a2300caf 100644
--- a/src/crates/concat/locales/ru.json
+++ b/src/crates/concat/locales/ru.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Назад на кадр",
"shortcuts.stepForward": "Вперёд на кадр",
"shortcuts.unboundNow": "Теперь у «{0}» нет клавиши",
+ "sounds.addedMany": "Звуков добавлено в вашу библиотеку: {0}",
+ "sounds.addedOne": "Звук добавлен в вашу библиотеку",
+ "sounds.couldNotCopy": "Не удалось скопировать {0} в проект: {1}",
+ "sounds.importSounds": "Импорт звуков",
+ "sounds.mine": "Мои звуки",
+ "sounds.mineHint": "Нажмите на звук, чтобы прослушать его, + — чтобы добавить его к указателю воспроизведения, или перетащите на таймлайн. Ваши звуки доступны здесь в любом проекте.",
+ "sounds.mineHintPhone": "Коснитесь звука, чтобы прослушать его, и +, чтобы добавить его к указателю воспроизведения. Ваши звуки доступны здесь в любом проекте.",
+ "sounds.noSoundsYet": "Своих звуков пока нет. Импортируйте звуковые файлы, и они останутся в вашей библиотеке, готовые для любого проекта.",
+ "sounds.notASound": "{0} — не звуковой файл",
+ "sounds.openProjectFirst": "Сначала откройте проект",
+ "sounds.removed": "{0} удалён из вашей библиотеки",
+ "sounds.sounds": "Звуки",
"speech.aboutInCharacters": "Около {0}:{1} голосом {2} · {3} символов",
"speech.american": "Американский",
"speech.anyVoiceRecording": "Любой голос из записи",
diff --git a/src/crates/concat/locales/th.json b/src/crates/concat/locales/th.json
index edb11bd3..8380ca24 100644
--- a/src/crates/concat/locales/th.json
+++ b/src/crates/concat/locales/th.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "ถอยหลังหนึ่งเฟรม",
"shortcuts.stepForward": "เดินหน้าหนึ่งเฟรม",
"shortcuts.unboundNow": "ตอนนี้ {0} ไม่มีแป้นแล้ว",
+ "sounds.addedMany": "เพิ่ม {0} เสียงลงในคลังของคุณแล้ว",
+ "sounds.addedOne": "เพิ่มเสียงลงในคลังของคุณแล้ว",
+ "sounds.couldNotCopy": "คัดลอก {0} ลงในโปรเจกต์ไม่ได้: {1}",
+ "sounds.importSounds": "นำเข้าเสียง",
+ "sounds.mine": "เสียงของฉัน",
+ "sounds.mineHint": "คลิกเสียงเพื่อฟัง กด + เพื่อเพิ่มที่หัวเล่น หรือลากไปวางบนไทม์ไลน์ เสียงของคุณอยู่ที่นี่ในทุกโปรเจกต์",
+ "sounds.mineHintPhone": "แตะเสียงเพื่อฟัง และแตะ + เพื่อเพิ่มที่หัวเล่น เสียงของคุณอยู่ที่นี่ในทุกโปรเจกต์",
+ "sounds.noSoundsYet": "ยังไม่มีเสียงของคุณเอง นำเข้าไฟล์เสียงแล้วเสียงจะอยู่ในคลังของคุณ พร้อมใช้ในทุกโปรเจกต์",
+ "sounds.notASound": "{0} ไม่ใช่ไฟล์เสียง",
+ "sounds.openProjectFirst": "เปิดโปรเจกต์ก่อน",
+ "sounds.removed": "นำ {0} ออกจากคลังของคุณแล้ว",
+ "sounds.sounds": "เสียง",
"speech.aboutInCharacters": "ประมาณ {0}:{1} ด้วยเสียง {2} · {3} ตัวอักษร",
"speech.american": "อเมริกัน",
"speech.anyVoiceRecording": "เสียงใดก็ได้ จากไฟล์บันทึก",
diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.json
index 0ebf4abf..a15e50e1 100644
--- a/src/crates/concat/locales/tr.json
+++ b/src/crates/concat/locales/tr.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Bir kare geri",
"shortcuts.stepForward": "Bir kare ileri",
"shortcuts.unboundNow": "{0} artık tuşsuz",
+ "sounds.addedMany": "Kitaplığınıza {0} ses eklendi",
+ "sounds.addedOne": "Kitaplığınıza bir ses eklendi",
+ "sounds.couldNotCopy": "{0} projeye kopyalanamadı: {1}",
+ "sounds.importSounds": "Ses içe aktar",
+ "sounds.mine": "Seslerim",
+ "sounds.mineHint": "Dinlemek için bir sese tıklayın, oynatma kafasına eklemek için + düğmesine basın ya da zaman çizelgesine sürükleyin. Sesleriniz her projede burada.",
+ "sounds.mineHintPhone": "Dinlemek için bir sese, oynatma kafasına eklemek için + düğmesine dokunun. Sesleriniz her projede burada.",
+ "sounds.noSoundsYet": "Henüz kendi sesiniz yok. Ses dosyalarını içe aktarın; kitaplığınızda kalır ve her projede kullanıma hazır olur.",
+ "sounds.notASound": "{0} bir ses dosyası değil",
+ "sounds.openProjectFirst": "Önce bir proje açın",
+ "sounds.removed": "{0} kitaplığınızdan kaldırıldı",
+ "sounds.sounds": "Sesler",
"speech.aboutInCharacters": "Yaklaşık {0}:{1}, {2} · {3} karakter",
"speech.american": "Amerikan",
"speech.anyVoiceRecording": "Bir kayıttan herhangi bir ses",
diff --git a/src/crates/concat/locales/uk.json b/src/crates/concat/locales/uk.json
index ab888eb1..f2adda8e 100644
--- a/src/crates/concat/locales/uk.json
+++ b/src/crates/concat/locales/uk.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Назад на кадр",
"shortcuts.stepForward": "Уперед на кадр",
"shortcuts.unboundNow": "Тепер «{0}» не має клавіші",
+ "sounds.addedMany": "Звуків додано до вашої бібліотеки: {0}",
+ "sounds.addedOne": "Звук додано до вашої бібліотеки",
+ "sounds.couldNotCopy": "Не вдалося скопіювати {0} до проєкту: {1}",
+ "sounds.importSounds": "Імпорт звуків",
+ "sounds.mine": "Мої звуки",
+ "sounds.mineHint": "Натисніть на звук, щоб прослухати його, + — щоб додати його до курсора відтворення, або перетягніть на таймлайн. Ваші звуки є тут у кожному проєкті.",
+ "sounds.mineHintPhone": "Торкніться звуку, щоб прослухати його, і +, щоб додати його до курсора відтворення. Ваші звуки є тут у кожному проєкті.",
+ "sounds.noSoundsYet": "Власних звуків поки немає. Імпортуйте звукові файли, і вони залишаться у вашій бібліотеці, готові для кожного проєкту.",
+ "sounds.notASound": "{0} — не звуковий файл",
+ "sounds.openProjectFirst": "Спершу відкрийте проєкт",
+ "sounds.removed": "{0} вилучено з вашої бібліотеки",
+ "sounds.sounds": "Звуки",
"speech.aboutInCharacters": "Близько {0}:{1}, голос {2} · символів: {3}",
"speech.american": "американський",
"speech.anyVoiceRecording": "Будь-який голос із запису",
diff --git a/src/crates/concat/locales/ur.json b/src/crates/concat/locales/ur.json
index a03ca5f6..d72286cd 100644
--- a/src/crates/concat/locales/ur.json
+++ b/src/crates/concat/locales/ur.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "ایک فریم پیچھے",
"shortcuts.stepForward": "ایک فریم آگے",
"shortcuts.unboundNow": "{0} کی اب کوئی کلید نہیں",
+ "sounds.addedMany": "آپ کی لائبریری میں {0} آوازیں شامل ہو گئیں",
+ "sounds.addedOne": "آپ کی لائبریری میں ایک آواز شامل ہو گئی",
+ "sounds.couldNotCopy": "{0} کو پروجیکٹ میں کاپی نہیں کیا جا سکا: {1}",
+ "sounds.importSounds": "آوازیں درآمد کریں",
+ "sounds.mine": "میری آوازیں",
+ "sounds.mineHint": "سننے کے لیے کسی آواز پر کلک کریں، پلے ہیڈ پر شامل کرنے کے لیے + دبائیں، یا اسے ٹائم لائن پر گھسیٹیں۔ آپ کی آوازیں ہر پروجیکٹ میں یہیں ہیں۔",
+ "sounds.mineHintPhone": "سننے کے لیے کسی آواز کو ٹیپ کریں، اور پلے ہیڈ پر شامل کرنے کے لیے +۔ آپ کی آوازیں ہر پروجیکٹ میں یہیں ہیں۔",
+ "sounds.noSoundsYet": "ابھی آپ کی اپنی کوئی آواز نہیں۔ آواز کی فائلیں درآمد کریں، وہ آپ کی لائبریری میں رہیں گی، ہر پروجیکٹ کے لیے تیار۔",
+ "sounds.notASound": "{0} آواز کی فائل نہیں ہے",
+ "sounds.openProjectFirst": "پہلے کوئی پروجیکٹ کھولیں",
+ "sounds.removed": "{0} آپ کی لائبریری سے ہٹا دی گئی",
+ "sounds.sounds": "آوازیں",
"speech.aboutInCharacters": "تقریباً {0}:{1}، {2} کی آواز میں · {3} حروف",
"speech.american": "امریکی",
"speech.anyVoiceRecording": "کوئی بھی آواز، ریکارڈنگ سے",
diff --git a/src/crates/concat/locales/vi.json b/src/crates/concat/locales/vi.json
index 7b16f20f..44665680 100644
--- a/src/crates/concat/locales/vi.json
+++ b/src/crates/concat/locales/vi.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "Lùi một khung hình",
"shortcuts.stepForward": "Tiến một khung hình",
"shortcuts.unboundNow": "{0} hiện không có phím",
+ "sounds.addedMany": "Đã thêm {0} âm thanh vào thư viện của bạn",
+ "sounds.addedOne": "Đã thêm một âm thanh vào thư viện của bạn",
+ "sounds.couldNotCopy": "Không thể sao chép {0} vào dự án: {1}",
+ "sounds.importSounds": "Nhập âm thanh",
+ "sounds.mine": "Âm thanh của tôi",
+ "sounds.mineHint": "Nhấp vào một âm thanh để nghe, nhấn + để thêm tại đầu phát, hoặc kéo nó lên dòng thời gian. Âm thanh của bạn có ở đây trong mọi dự án.",
+ "sounds.mineHintPhone": "Chạm vào một âm thanh để nghe, và + để thêm tại đầu phát. Âm thanh của bạn có ở đây trong mọi dự án.",
+ "sounds.noSoundsYet": "Bạn chưa có âm thanh riêng nào. Hãy nhập tệp âm thanh, chúng sẽ ở lại trong thư viện của bạn, sẵn sàng cho mọi dự án.",
+ "sounds.notASound": "{0} không phải là tệp âm thanh",
+ "sounds.openProjectFirst": "Hãy mở một dự án trước",
+ "sounds.removed": "Đã xóa {0} khỏi thư viện của bạn",
+ "sounds.sounds": "Âm thanh",
"speech.aboutInCharacters": "Khoảng {0}:{1} trong {2} · {3} ký tự",
"speech.american": "Mỹ",
"speech.anyVoiceRecording": "Bất kỳ giọng nói nào từ bản ghi âm",
diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.json
index 89670199..e814f56e 100644
--- a/src/crates/concat/locales/zh-Hans.json
+++ b/src/crates/concat/locales/zh-Hans.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "后退一帧",
"shortcuts.stepForward": "前进一帧",
"shortcuts.unboundNow": "{0}现在没有按键",
+ "sounds.addedMany": "已将 {0} 个声音添加到你的资料库",
+ "sounds.addedOne": "已将一个声音添加到你的资料库",
+ "sounds.couldNotCopy": "无法将 {0} 复制到项目中:{1}",
+ "sounds.importSounds": "导入声音",
+ "sounds.mine": "我的声音",
+ "sounds.mineHint": "点击声音即可试听,按 + 添加到播放头处,或将其拖到时间线上。你的声音在每个项目中都在这里。",
+ "sounds.mineHintPhone": "轻点声音即可试听,点 + 添加到播放头处。你的声音在每个项目中都在这里。",
+ "sounds.noSoundsYet": "还没有你自己的声音。导入声音文件后,它们会留在你的资料库中,每个项目都能用。",
+ "sounds.notASound": "{0} 不是声音文件",
+ "sounds.openProjectFirst": "请先打开一个项目",
+ "sounds.removed": "已从你的资料库中移除 {0}",
+ "sounds.sounds": "声音",
"speech.aboutInCharacters": "约 {0}:{1}({2})· {3} 个字符",
"speech.american": "美式",
"speech.anyVoiceRecording": "任意声音,源自录音",
diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.json
index 19fa5f12..2162fed1 100644
--- a/src/crates/concat/locales/zh-TW.json
+++ b/src/crates/concat/locales/zh-TW.json
@@ -519,6 +519,18 @@
"shortcuts.stepBack": "後退一個影格",
"shortcuts.stepForward": "前進一個影格",
"shortcuts.unboundNow": "{0}目前沒有按鍵",
+ "sounds.addedMany": "已將 {0} 個聲音加入你的資料庫",
+ "sounds.addedOne": "已將一個聲音加入你的資料庫",
+ "sounds.couldNotCopy": "無法將 {0} 複製到專案中:{1}",
+ "sounds.importSounds": "匯入聲音",
+ "sounds.mine": "我的聲音",
+ "sounds.mineHint": "點選聲音即可試聽,按 + 加到播放頭處,或將它拖到時間軸上。你的聲音在每個專案中都在這裡。",
+ "sounds.mineHintPhone": "輕觸聲音即可試聽,點 + 加到播放頭處。你的聲音在每個專案中都在這裡。",
+ "sounds.noSoundsYet": "還沒有你自己的聲音。匯入聲音檔後,它們會留在你的資料庫中,每個專案都能用。",
+ "sounds.notASound": "{0} 不是聲音檔",
+ "sounds.openProjectFirst": "請先開啟一個專案",
+ "sounds.removed": "已從你的資料庫移除 {0}",
+ "sounds.sounds": "聲音",
"speech.aboutInCharacters": "約 {0}:{1}({2})· {3} 個字元",
"speech.american": "美式",
"speech.anyVoiceRecording": "任意聲音,源自錄音",
diff --git a/src/crates/concat/src/format.rs b/src/crates/concat/src/format.rs
index dbfcca05..c3428b71 100644
--- a/src/crates/concat/src/format.rs
+++ b/src/crates/concat/src/format.rs
@@ -241,6 +241,33 @@ pub const WAVE_PITCH: f32 = 3.0;
/// own; see `media_bin`.
pub const WAVE_BAR: f32 = 2.0 / 3.0;
+/// An envelope already reduced to one peak a bar - a library sound's,
+/// read once at import - drawn the way [`wave_path`] draws a file's: bars
+/// about the centre line, each the leading `bar` of its pitch, in a 1x1
+/// box.
+pub fn bars_path(bars: &[f32], bar: f32) -> String {
+ /// See `wave_path`: silence is a hairline, not a gap.
+ const FLOOR: f32 = 0.024;
+ if bars.is_empty() {
+ return String::new();
+ }
+ let bar = bar.clamp(0.1, 1.0);
+ let pitch = 1.0 / bars.len() as f32;
+ let mut path = String::with_capacity(bars.len() * 56);
+ for (column, amplitude) in bars.iter().enumerate() {
+ let left = column as f32 * pitch;
+ let right = left + pitch * bar;
+ let amplitude = amplitude.clamp(0.0, 1.0).max(FLOOR);
+ let top = 0.5 - amplitude / 2.0;
+ let bottom = 0.5 + amplitude / 2.0;
+ path.push_str(&format!(
+ "M {left:.4} {top:.4} L {right:.4} {top:.4} \
+ L {right:.4} {bottom:.4} L {left:.4} {bottom:.4} Z "
+ ));
+ }
+ path
+}
+
/// How many bars a span of `seconds` gets at `seconds_per_pixel`: one a
/// [`WAVE_PITCH`], rounded up to the next sixteen so a zoom rebuilds the
/// path at each step of that and not at every pixel, held to what
diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rs
index c9186ff7..e89c217d 100644
--- a/src/crates/concat/src/lib.rs
+++ b/src/crates/concat/src/lib.rs
@@ -98,6 +98,7 @@ use panes::monitor::MonitorMsg;
use panes::project::ProjectMsg;
use panes::relink::RelinkMsg;
use panes::settings::SettingsMsg;
+use panes::sounds::SoundsMsg;
use panes::speech::SpeechMsg;
use panes::start::StartMsg;
use panes::timeline::TimelineMsg;
@@ -220,7 +221,20 @@ fn start(project: Option<std::path::PathBuf>, smoke: bool) -> Result<(), slint::
Shell::with(|shell, app| {
{
let mut studio = shell.studio.borrow_mut();
- studio.handle(Msg::Media(MediaMsg::Import(paths)));
+ // Sound files dropped while the library shows its
+ // Audio page go into the user's own sounds, as its
+ // Import would take them; anything else, or the page
+ // not up, into the project's bin.
+ let to_library = studio.sounds.shown
+ && !paths.is_empty()
+ && paths
+ .iter()
+ .all(|path| concat_host::sounds::is_sound(path));
+ if to_library {
+ studio.handle(Msg::Sounds(SoundsMsg::Import(paths)));
+ } else {
+ studio.handle(Msg::Media(MediaMsg::Import(paths)));
+ }
}
shell.studio.borrow_mut().refresh_art();
shell.studio.borrow().publish(&app, &shell.models);
@@ -368,6 +382,8 @@ fn start(project: Option<std::path::PathBuf>, smoke: bool) -> Result<(), slint::
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()));
+ app.global::<Sounds>()
+ .set_mine(ModelRc::from(models.sounds_mine.clone()));
app.set_voiceover_devices(ModelRc::from(models.voiceover_devices.clone()));
app.set_app_menu_items(ModelRc::from(models.bar.clone()));
app.set_transcribers(ModelRc::from(models.transcribers.clone()));
@@ -1310,6 +1326,32 @@ fn start(project: Option<std::path::PathBuf>, smoke: bool) -> Result<(), slint::
app.global::<SourcePreview>().on_closed(on_window!(|state| {
state.close_source();
}));
+
+ // ── the library's Audio page ──
+ {
+ let sounds = app.global::<Sounds>();
+ // The picker answers on a turn of its own, the way the bin's does;
+ // see `host::pick_files_then`.
+ sounds.on_import(|| {
+ host::pick_files_then(
+ i18n::t("sounds.importSounds"),
+ Some((i18n::t("common.audio"), &concat_host::sounds::EXTENSIONS)),
+ |studio, _, _, paths| studio.handle(Msg::Sounds(SoundsMsg::Import(paths))),
+ );
+ });
+ sounds.on_preview(on_window!(|state, id: SharedString| {
+ state.handle(Msg::Sounds(SoundsMsg::Preview(id.to_string())));
+ }));
+ sounds.on_add(on_window!(|state, id: SharedString| {
+ state.handle(Msg::Sounds(SoundsMsg::Add(id.to_string())));
+ }));
+ sounds.on_remove(on_window!(|state, id: SharedString| {
+ state.handle(Msg::Sounds(SoundsMsg::Remove(id.to_string())));
+ }));
+ sounds.on_shown(on_window!(|state, on: bool| {
+ state.handle(Msg::Sounds(SoundsMsg::Shown(on)));
+ }));
+ }
app.global::<SourcePreview>()
.on_seek(on_window!(|state, seconds: f32| {
state.source_seek(f64::from(seconds));
diff --git a/src/crates/concat/src/panes/mod.rs b/src/crates/concat/src/panes/mod.rs
index 0511a79b..dfc41e13 100644
--- a/src/crates/concat/src/panes/mod.rs
+++ b/src/crates/concat/src/panes/mod.rs
@@ -23,6 +23,7 @@ pub mod pace;
pub mod project;
pub mod relink;
pub mod settings;
+pub mod sounds;
pub mod speech;
pub mod start;
pub mod timeline;
@@ -53,6 +54,8 @@ pub enum Msg {
Timeline(timeline::TimelineMsg),
/// To the voiceover take.
Voiceover(voiceover::VoiceoverMsg),
+ /// To the library's Audio page.
+ Sounds(sounds::SoundsMsg),
}
/// What a message says in the log: the activity trail of what the person
diff --git a/src/crates/concat/src/panes/sounds.rs b/src/crates/concat/src/panes/sounds.rs
new file mode 100644
index 00000000..8f788343
--- /dev/null
+++ b/src/crates/concat/src/panes/sounds.rs
@@ -0,0 +1,323 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors
+
+//! The library's Audio page (#60): the user's own sounds, kept across
+//! projects.
+//!
+//! A sound comes in by the page's Import button, or by being dropped on
+//! the window while the page is up; it is copied into the app's own
+//! folder (see `concat_host::sounds`) on a worker, and its card shows its
+//! name, its length and its envelope. A click plays it through the source
+//! preview, as a sound in the bin plays; its plus lays it at the playhead
+//! on the first lane with room, and a drag lays it where it is dropped.
+//! Either way it is copied into the project's folder and imported into the
+//! bin first, so the project owns its own copy and a sound later removed
+//! from the library takes nothing with it.
+//!
+//! A card is named by an id with its shelf in front - `mine-…` - so one
+//! payload, `sound:<card>:<name>`, carries any shelf's sound.
+
+use std::cell::RefCell;
+use std::collections::HashMap;
+use std::path::{Path, PathBuf};
+
+use concat_host::sounds::{self, Library, Sound};
+use concat_project::Command;
+use slint::SharedString;
+
+use crate::i18n::{t, tf};
+use crate::panes::Msg;
+use crate::studio::Studio;
+use crate::ui::SoundCardData;
+
+/// The prefix of a card id on the Mine shelf.
+const MINE: &str = "mine-";
+
+/// Everything that can happen to the Audio page.
+#[derive(Clone, Debug)]
+pub enum SoundsMsg {
+ /// Files picked, or dropped while the page was up.
+ Import(Vec<PathBuf>),
+ /// The import's worker is done copying and reading.
+ Imported(Vec<Result<Sound, String>>),
+ /// A card clicked: play it, or pause it when it is the one playing.
+ Preview(String),
+ /// A card's plus: onto the timeline at the playhead.
+ Add(String),
+ /// "Remove from library": the copy deleted.
+ Remove(String),
+ /// Whether a library is showing the page, so a drop of sound files on
+ /// the window goes into the library rather than the bin.
+ Shown(bool),
+}
+
+/// The page's state.
+#[derive(Default)]
+pub struct SoundsPane {
+ /// The user's own sounds.
+ pub library: Library,
+ /// A library is showing the page.
+ pub shown: bool,
+ /// A sound import running.
+ pub importing: bool,
+ /// Each card's envelope as path commands, by card id: the cards are
+ /// published on every frame of playback, and the path is the one
+ /// expensive line of one.
+ waves: RefCell<HashMap<String, SharedString>>,
+}
+
+impl SoundsPane {
+ /// The library as it is on this machine's disk.
+ pub fn open(dirs: &concat_host::AppDirs) -> SoundsPane {
+ SoundsPane {
+ library: Library::open(dirs),
+ ..SoundsPane::default()
+ }
+ }
+
+ /// Applies one message. The studio is the rest of the window; while
+ /// this runs the studio's copy of the pane is a blank it must not read.
+ pub fn update(&mut self, msg: SoundsMsg, studio: &mut Studio) {
+ match msg {
+ SoundsMsg::Shown(on) => self.shown = on,
+ SoundsMsg::Import(paths) => {
+ let (taken, refused): (Vec<PathBuf>, Vec<PathBuf>) =
+ paths.into_iter().partition(|path| sounds::is_sound(path));
+ if let Some(path) = refused.first() {
+ studio.notify(
+ &tf("sounds.notASound", &[&display_name(path)]),
+ true,
+ );
+ }
+ if taken.is_empty() {
+ return;
+ }
+ self.importing = true;
+ let dir = self.library.dir.clone();
+ crate::host::spawn(
+ move || {
+ taken
+ .iter()
+ .map(|path| sounds::prepare(&dir, path))
+ .collect::<Vec<_>>()
+ },
+ |studio, _, _, results| {
+ studio.handle(Msg::Sounds(SoundsMsg::Imported(results)));
+ },
+ );
+ }
+ SoundsMsg::Imported(results) => {
+ self.importing = false;
+ let mut added = 0;
+ let mut failure = None;
+ // Oldest first, so the last picked ends up at the top
+ // with the rest of them under it in the order picked.
+ for result in results.into_iter().rev() {
+ match result.and_then(|sound| self.library.add(sound)) {
+ Ok(()) => added += 1,
+ Err(error) => failure = Some(error),
+ }
+ }
+ if let Some(error) = failure {
+ studio.notify(&error, true);
+ } else if added == 1 {
+ studio.notify(&t("sounds.addedOne"), false);
+ } else if added > 1 {
+ studio.notify(&tf("sounds.addedMany", &[&added]), false);
+ }
+ }
+ SoundsMsg::Preview(card) => {
+ if let Some((name, path)) = self.file_of(&card) {
+ studio.preview_file(&card, &name, &path);
+ }
+ }
+ SoundsMsg::Add(card) => {
+ if let Some((name, path)) = self.file_of(&card) {
+ studio.place_sound(&name, &path, None, f64::from(studio.playhead.max(0.0)));
+ }
+ }
+ SoundsMsg::Remove(card) => {
+ let Some(id) = card.strip_prefix(MINE) else {
+ return;
+ };
+ // Not playing what is about to be deleted.
+ if studio
+ .source
+ .as_ref()
+ .is_some_and(|source| source.card == card)
+ {
+ studio.close_source();
+ }
+ let name = self
+ .library
+ .get(id)
+ .map(|sound| sound.name.clone())
+ .unwrap_or_default();
+ match self.library.remove(id) {
+ Ok(()) => {
+ self.waves.borrow_mut().remove(&card);
+ studio.notify(&tf("sounds.removed", &[&name]), false);
+ }
+ Err(error) => studio.notify(&error, true),
+ }
+ }
+ }
+ }
+
+ /// The name and the file a card stands for, when it is on disk.
+ pub fn file_of(&self, card: &str) -> Option<(String, PathBuf)> {
+ let id = card.strip_prefix(MINE)?;
+ let sound = self.library.get(id)?;
+ Some((sound.name.clone(), self.library.path_of(sound)))
+ }
+
+ /// A card as a payload names it, for a drop: its name and its length.
+ pub fn summary(&self, card: &str) -> Option<(String, f64)> {
+ let id = card.strip_prefix(MINE)?;
+ let sound = self.library.get(id)?;
+ Some((sound.name.clone(), sound.duration))
+ }
+
+ /// The Mine shelf's cards.
+ pub fn mine(&self) -> Vec<SoundCardData> {
+ self.library
+ .sounds
+ .iter()
+ .map(|sound| {
+ let card = format!("{MINE}{}", sound.id);
+ SoundCardData {
+ wave: self.wave(&card, &sound.bars),
+ id: card.into(),
+ name: sound.name.as_str().into(),
+ duration: sound.duration as f32,
+ detail: SharedString::new(),
+ removable: true,
+ ready: true,
+ progress: -1.0,
+ }
+ })
+ .collect()
+ }
+
+ /// The envelope of a card, drawn once.
+ fn wave(&self, card: &str, bars: &[f32]) -> SharedString {
+ if bars.is_empty() {
+ return SharedString::new();
+ }
+ self.waves
+ .borrow_mut()
+ .entry(card.to_owned())
+ .or_insert_with(|| crate::format::bars_path(bars, 0.7).into())
+ .clone()
+ }
+}
+
+/// A file's name, for a notice.
+fn display_name(path: &Path) -> String {
+ path.file_name()
+ .map(|name| name.to_string_lossy().into_owned())
+ .unwrap_or_else(|| path.display().to_string())
+}
+
+impl Studio {
+ /// What a `sound:` payload's card is, for the drop's plan: its name
+ /// and length.
+ pub fn sound_summary(&self, card: &str) -> Option<(String, f64)> {
+ self.sounds.summary(card)
+ }
+
+ /// A card dropped on a lane, or added at the playhead: see
+ /// [`Studio::place_sound`].
+ pub fn place_card(&mut self, card: &str, track_id: Option<String>, start: f64) {
+ if let Some((name, path)) = self.sounds.file_of(card) {
+ self.place_sound(&name, &path, track_id, start);
+ }
+ }
+
+ /// Lays a library sound on the timeline: copied into the project's
+ /// folder and imported into the bin first - once; a second use finds
+ /// the copy already there - then cut onto `track_id` at `start`, or at
+ /// `start` on the first lane with room. Selects what it made.
+ pub fn place_sound(&mut self, name: &str, path: &Path, track_id: Option<String>, start: f64) {
+ let media_id = match self.adopt_sound(name, path) {
+ Ok(id) => id,
+ Err(error) => {
+ self.notify(&error, true);
+ return;
+ }
+ };
+ // Onto the timeline: the monitor and the speakers go back to it.
+ self.close_source();
+ let created = match track_id {
+ Some(track_id) => self.apply(Command::AddClip {
+ media_id,
+ track_id,
+ start,
+ ripple: true,
+ }),
+ None => self.apply(Command::AddClipAtFirstFree { media_id, start }),
+ };
+ if let Some(id) = created {
+ self.selection = vec![id];
+ }
+ }
+
+ /// The bin's id for a library sound in this project: its copy in the
+ /// project's `audio` folder, made and imported when it is not there
+ /// yet. A file of that name that is not this sound - another size -
+ /// leaves it alone and the copy takes a numbered name.
+ fn adopt_sound(&mut self, name: &str, path: &Path) -> Result<String, String> {
+ let project = self
+ .session
+ .as_ref()
+ .map(|session| PathBuf::from(session.path()))
+ .ok_or_else(|| t("sounds.openProjectFirst"))?;
+ let folder = project.join("audio");
+ let size = std::fs::metadata(path)
+ .map_err(|error| format!("{}: {error}", path.display()))?
+ .len();
+ let stem = path
+ .file_stem()
+ .map(|stem| stem.to_string_lossy().into_owned())
+ .unwrap_or_else(|| name.to_owned());
+ let extension = path
+ .extension()
+ .map(|extension| format!(".{}", extension.to_string_lossy()))
+ .unwrap_or_default();
+ let mut target = folder.join(format!("{stem}{extension}"));
+ let mut n = 2;
+ while target.exists()
+ && std::fs::metadata(&target).map(|meta| meta.len()).ok() != Some(size)
+ {
+ target = folder.join(format!("{stem} {n}{extension}"));
+ n += 1;
+ }
+ let target_text = target.to_string_lossy().into_owned();
+ if let Some(item) = self
+ .project()
+ .media
+ .iter()
+ .find(|item| item.path == target_text)
+ {
+ return Ok(item.id.clone());
+ }
+ if !target.exists() {
+ std::fs::create_dir_all(&folder)
+ .and_then(|()| std::fs::copy(path, &target).map(drop))
+ .map_err(|error| tf("sounds.couldNotCopy", &[&name, &error]))?;
+ }
+ let summary = concat_host::media::probe(&target_text)?;
+ let mut item = summary.to_new_media();
+ item.name = format!("{name}{extension}");
+ let created = self.apply(Command::AddMedia { item });
+ created
+ .or_else(|| {
+ self.project()
+ .media
+ .iter()
+ .find(|item| item.path == target_text)
+ .map(|item| item.id.clone())
+ })
+ .ok_or_else(|| tf("sounds.couldNotCopy", &[&name, &"?"]))
+ }
+}
diff --git a/src/crates/concat/src/source.rs b/src/crates/concat/src/source.rs
index d07210cb..d5efe82d 100644
--- a/src/crates/concat/src/source.rs
+++ b/src/crates/concat/src/source.rs
@@ -20,15 +20,18 @@ use concat_project::model::{MediaKind, Project};
use crate::studio::Studio;
use crate::ui::SourcePreview;
-use slint::ComponentHandle;
+use slint::{ComponentHandle, SharedString};
/// The file lent to the monitor and the speakers.
pub struct Source {
pub media_id: String,
pub name: String,
pub kind: MediaKind,
- /// The bin's row for the file, for its card to show the playing line.
+ /// The bin's row for the file, for its card to show the playing line;
+ /// -1 for a sound from the Audio page.
pub row: i32,
+ /// The Audio page's card for the file, or empty for one in the bin.
+ pub card: String,
/// The scratch project flattened, as the monitor draws it.
pub clips: Arc<Vec<concat_export::ExportClip>>,
pub duration: f64,
@@ -65,6 +68,7 @@ impl Studio {
pub fn preview_media(&mut self, media_id: &str, row: i32) {
if let Some(source) = self.source.as_ref()
&& source.media_id == media_id
+ && source.card.is_empty()
{
if source.kind == MediaKind::Audio {
self.source_toggle();
@@ -109,6 +113,7 @@ impl Studio {
name: media.name.clone(),
kind: media.kind,
row,
+ card: String::new(),
clips,
duration,
time: 0.0,
@@ -121,6 +126,84 @@ impl Studio {
self.request_preview();
}
+ /// A card on the Audio page was clicked: its sound plays through the
+ /// speakers as a sound from the bin does, without being in the bin, or
+ /// pauses when it is the one playing. `card` names it for its card's
+ /// playing line.
+ pub fn preview_file(&mut self, card: &str, name: &str, path: &std::path::Path) {
+ if let Some(source) = self.source.as_ref()
+ && source.card == card
+ {
+ self.source_toggle();
+ return;
+ }
+ let Some(project_dir) = self
+ .session
+ .as_ref()
+ .map(|session| std::path::PathBuf::from(session.path()))
+ else {
+ return;
+ };
+ let summary = match concat_host::media::probe(&path.to_string_lossy()) {
+ Ok(summary) => summary,
+ Err(error) => {
+ self.notify(&crate::host::probe_error(&error), true);
+ return;
+ }
+ };
+ // The scratch project with the file in its bin, under an id no
+ // real item has, and the one clip cut from it.
+ let mut scratch = self.project().clone();
+ scratch.media.retain(|item| item.path != summary.path);
+ let mut mint = IdMint::default();
+ mint.adopt_project(&scratch);
+ let Ok(Some(media_id)) = commands::apply(
+ &mut scratch,
+ &mut mint,
+ Command::AddMedia {
+ item: summary.to_new_media(),
+ },
+ )
+ .map(|outcome| outcome.created_id) else {
+ return;
+ };
+ let Some(scratch) = self::scratch(&scratch, &media_id) else {
+ return;
+ };
+ self.pause();
+ if let Some(old) = self.source.take() {
+ old.timer.stop();
+ }
+ let clips = Arc::new(concat_export::flatten::flatten_timeline_in(
+ &scratch,
+ None,
+ Some(&project_dir),
+ ));
+ let duration = scratch
+ .active()
+ .clips
+ .first()
+ .map_or(0.0, |clip| clip.duration);
+ self.host
+ .playback
+ .set_clips(project_dir, crate::studio::audio_specs(&clips));
+ self.host.playback.seek(0.0);
+ self.source = Some(Source {
+ media_id,
+ name: name.to_owned(),
+ kind: MediaKind::Audio,
+ row: -1,
+ card: card.to_owned(),
+ clips,
+ duration,
+ time: 0.0,
+ playing: false,
+ timer: slint::Timer::default(),
+ });
+ self.source_toggle();
+ self.request_preview();
+ }
+
/// Back to the timeline: its picture on the monitor, its sound in the
/// speakers, the transport where the playhead was.
pub fn close_source(&mut self) {
@@ -202,6 +285,7 @@ impl Studio {
preview.set_open(true);
preview.set_name(source.name.as_str().into());
preview.set_row(source.row);
+ preview.set_card(source.card.as_str().into());
preview.set_time(source.time as f32);
preview.set_duration(source.duration as f32);
preview.set_playing(source.playing);
@@ -214,6 +298,7 @@ impl Studio {
None => {
preview.set_open(false);
preview.set_row(-1);
+ preview.set_card(SharedString::new());
preview.set_playing(false);
}
}
diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rs
index c9c9313b..c732f91a 100644
--- a/src/crates/concat/src/studio.rs
+++ b/src/crates/concat/src/studio.rs
@@ -674,6 +674,8 @@ pub struct Models {
pub voiceover_devices: Rc<VecModel<SharedString>>,
pub speech_sample_waves: Rc<VecModel<SharedString>>,
pub speech_sample_details: Rc<VecModel<SharedString>>,
+ /// The Audio page's shelves.
+ pub sounds_mine: Rc<VecModel<crate::ui::SoundCardData>>,
pub transcribers: Rc<VecModel<ModelData>>,
pub voices: Rc<VecModel<ModelData>>,
/// The Version page's releases, and beside each its day or that it
@@ -744,6 +746,7 @@ impl Models {
voiceover_devices: Rc::new(VecModel::default()),
speech_sample_waves: Rc::new(VecModel::default()),
speech_sample_details: Rc::new(VecModel::default()),
+ sounds_mine: Rc::new(VecModel::default()),
transcribers: Rc::new(VecModel::default()),
voices: Rc::new(VecModel::default()),
versions: Rc::new(VecModel::default()),
@@ -980,6 +983,8 @@ pub struct Studio {
pub project_sheet: crate::panes::project::ProjectPane,
pub captions: crate::panes::captions::CaptionsPane,
pub speech: crate::panes::speech::SpeechPane,
+ /// The library's Audio page: the user's own sounds.
+ pub sounds: crate::panes::sounds::SoundsPane,
/// A file from the library lent the monitor and the speakers; see
/// `crate::source`.
pub source: Option<crate::source::Source>,
@@ -2310,6 +2315,7 @@ impl Studio {
project_sheet: crate::panes::project::ProjectPane::default(),
captions: crate::panes::captions::CaptionsPane::default(),
speech: crate::panes::speech::SpeechPane::default(),
+ sounds: crate::panes::sounds::SoundsPane::open(&host.dirs),
source: None,
meters: crate::meters::MeterFeed::default(),
voiceover: crate::panes::voiceover::VoiceoverPane::default(),
@@ -3734,6 +3740,19 @@ impl Studio {
duration: LAYER_DURATION,
row: 0,
}),
+ // A sound from the Audio page: not in the bin yet, so its card
+ // rides in `media` behind `sound:`, and the drop imports it.
+ "sound" => {
+ let (name, duration) = self.sound_summary(id)?;
+ Some(DropPlan {
+ kind: ClipKind::Audio,
+ label: name,
+ media: format!("sound:{id}"),
+ start: 0.0,
+ duration: (duration as f32).max(MIN_DURATION),
+ row: 0,
+ })
+ }
// A look dragged from the Filters page: a layer over a span.
// The package id rides in `media`, there being no file.
"filter" => Some(DropPlan {
@@ -3790,6 +3809,10 @@ impl Studio {
let Some(track_id) = self.row_track(plan.row).map(|track| track.id.clone()) else {
return;
};
+ if let Some(card) = plan.media.strip_prefix("sound:") {
+ self.place_card(card, Some(track_id), f64::from(plan.start));
+ return;
+ }
let created = if plan.kind == ClipKind::Text {
self.add_title(
Some(track_id),
@@ -3843,6 +3866,10 @@ impl Studio {
return;
};
let start = f64::from(self.playhead.max(0.0));
+ if let Some(card) = plan.media.strip_prefix("sound:") {
+ self.place_card(card, None, start);
+ return;
+ }
let created = if plan.kind == ClipKind::Text {
self.add_title(None, start, f64::from(plan.duration), &plan.media)
} else if plan.kind == ClipKind::Shape {
@@ -8391,6 +8418,11 @@ impl Studio {
pane.update(msg, self);
self.voiceover = pane;
}
+ crate::panes::Msg::Sounds(msg) => {
+ let mut pane = std::mem::take(&mut self.sounds);
+ pane.update(msg, self);
+ self.sounds = pane;
+ }
crate::panes::Msg::Relink(msg) => {
let mut pane = std::mem::take(&mut self.relink);
pane.update(msg, self);
@@ -10817,6 +10849,10 @@ impl Studio {
self.speech.sample_detail_rows(self),
);
app.set_speech(self.speech.data(self));
+ // The Audio page.
+ sync(&models.sounds_mine, self.sounds.mine());
+ app.global::<crate::ui::Sounds>()
+ .set_importing(self.sounds.importing);
self.publish_source(app);
sync(&models.voiceover_devices, self.voiceover.device_rows());
app.set_voiceover(self.voiceover.data(self));
diff --git a/src/crates/concat/ui/app.slint b/src/crates/concat/ui/app.slint
index 54580fb7..11434cd5 100644
--- a/src/crates/concat/ui/app.slint
+++ b/src/crates/concat/ui/app.slint
@@ -20,6 +20,7 @@ import { Theme } from "theme/theme.slint";
import { Bezier, Curves, Fmt, Focus, Payload } from "util.slint";
import { EffectData } from "demo/effects-panel.slint";
import { MediaFilter, MediaItemData, MediaKind, SourcePreview, TextPresetData } from "workspace/media-pane.slint";
+import { SoundCardData, Sounds } from "workspace/audio-page.slint";
import { ContextMenu, MenuItemData, MenuRow } from "primitives/context-menu.slint";
import { ExportData, ExportDialog, ExportPhase } from "dialogs/export.slint";
import { ModelData, SettingsData, SettingsDialog, SystemFactData } from "dialogs/settings.slint";
@@ -64,7 +65,7 @@ export {
SelectedClipData, SelectedTransitionData, StageGuideData, StageItemData, TextAlignment, TimelineTabData,
TimelineTool, TrackData, TrackSize, MenuItemData, MenuRow, ExportData, ExportPhase, ModelData, SettingsData,
ChipOption, RecentProjectData, StartData, SystemFactData, ToastData, ProjectSheetData,
- CaptionsSheetData, SpeechSheetData, VoiceoverData,
+ CaptionsSheetData, SpeechSheetData, VoiceoverData, SoundCardData, Sounds,
}
export component App inherits Window {
diff --git a/src/crates/concat/ui/phone/editor.slint b/src/crates/concat/ui/phone/editor.slint
index ad8bb4c8..5fe40105 100644
--- a/src/crates/concat/ui/phone/editor.slint
+++ b/src/crates/concat/ui/phone/editor.slint
@@ -22,6 +22,7 @@ import { TextPanel } from "../inspector/text-panel.slint";
import { RoundButton, ToolItem, ToolStrip } from "controls.slint";
import { PhoneSheet } from "sheet.slint";
import { PhoneCanvas } from "canvas.slint";
+import { Sounds, SoundList } from "../workspace/audio-page.slint";
// The editor as a phone shows it: one screen, held upright, driven by a
// finger. Shown in place of the title strip and the dock wherever the
@@ -376,6 +377,7 @@ export component PhoneEditor inherits Rectangle {
pure function sheet-title(name: string) -> string {
return name == "media" ? I18n.t("common.media")
+ : name == "audio" ? I18n.t("common.audio")
: name == "text" || name == "clip-text" ? I18n.t("common.text")
: name == "effects" || name == "clip-effects" ? I18n.t("common.effects")
: name == "filters" ? I18n.t("mediaPane.filters")
@@ -839,6 +841,13 @@ export component PhoneEditor inherits Rectangle {
current: root.sheet == "media";
clicked => { root.show("media", false); }
}
+ // Beside Media, as CapCut keeps it: the user's own sounds.
+ ToolItem {
+ glyph: Glyph.music;
+ label: I18n.t("common.audio");
+ current: root.sheet == "audio";
+ clicked => { root.show("audio", false); }
+ }
ToolItem {
glyph: Glyph.text-mark;
label: I18n.t("common.text");
@@ -1122,6 +1131,30 @@ export component PhoneEditor inherits Rectangle {
}
}
+ // ── the user's own sounds: brought in from the phone's files,
+ // played with a tap, laid at the playhead with the plus ──
+ if root.sheet == "audio": VerticalLayout {
+ padding: 12px;
+ spacing: 12px;
+
+ SheetButton {
+ glyph: Glyph.import;
+ primary: true;
+ enabled: !Sounds.importing;
+ label: Sounds.importing ? I18n.t("mediaPane.importing") : I18n.t("sounds.importSounds");
+ clicked => { Sounds.import(); }
+ }
+ SheetNote {
+ text: Sounds.mine.length == 0
+ ? I18n.t("sounds.noSoundsYet") : I18n.t("sounds.mineHintPhone");
+ }
+ SoundList {
+ items: Sounds.mine;
+ touch-sized: true;
+ added => { root.hide(); }
+ }
+ }
+
// ── titles ──
if root.sheet == "text": VerticalLayout {
padding: 12px;
diff --git a/src/crates/concat/ui/workspace/audio-page.slint b/src/crates/concat/ui/workspace/audio-page.slint
new file mode 100644
index 00000000..1ddf1c8c
--- /dev/null
+++ b/src/crates/concat/ui/workspace/audio-page.slint
@@ -0,0 +1,236 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors
+
+import { I18n } from "../i18n.slint";
+import { Theme, Fmt, Glyph, Icon, Payload } from "../primitives/primitives.slint";
+import { Wave } from "../primitives/wave.slint";
+import { SourcePreview } from "source-preview.slint";
+
+// The library's Audio page (#60): sounds of the user's own, kept across
+// projects. A sound is a row rather than a tile, the way every editor's
+// audio library lists them: what tells two sounds apart is a name and a
+// length, and a row gives both their room, with the envelope beside them.
+//
+// One global for the page's data and verbs, read by the desk's library
+// pane and the phone's sheet alike, so neither threads them through a
+// seat.
+
+/// One sound, as a row shows it.
+export struct SoundCardData {
+ /// Its card: the shelf, then the sound - `mine-…`. What a drag
+ /// carries and what every verb is given back.
+ id: string,
+ name: string,
+ /// seconds
+ duration: float,
+ /// The envelope as path commands in a 1x1 box, or empty.
+ wave: string,
+ /// A second line beside the length: a category, a licence.
+ detail: string,
+ /// "Remove from library" is offered: a sound of the user's own.
+ removable: bool,
+ /// On disk and ready to play or lay down. A sound that is not is
+ /// fetched on its first use.
+ ready: bool,
+ /// How far a fetch has got, `0..=1`, or below zero when none runs.
+ progress: float,
+}
+
+export global Sounds {
+ /// The Mine shelf: the user's own sounds, newest first.
+ in property <[SoundCardData]> mine;
+ /// Sounds are being copied in.
+ in property <bool> importing;
+
+ /// The Import button: the system's picker, for sound files.
+ callback import();
+ /// A row clicked: play it, or pause it when it is the one playing.
+ callback preview(id: string);
+ /// A row's plus: onto the timeline at the playhead, on the first lane
+ /// with room.
+ callback add(id: string);
+ /// "Remove from library": the copy deleted.
+ callback remove(id: string);
+ /// A library pane turned to the page or away from it: a drop of sound
+ /// files on the window goes into the library while it is up.
+ callback shown(on: bool);
+}
+
+// A small square button on a row: the plus, the cross.
+component RowButton inherits Rectangle {
+ in property <Glyph> glyph;
+ in property <bool> danger;
+ in property <length> size: 22px;
+ callback clicked();
+
+ width: root.size;
+ height: root.size;
+ border-radius: Theme.r-xs;
+ background: touch.has-hover ? (root.danger ? Theme.danger : Theme.accent) : Theme.field;
+
+ Icon {
+ x: (parent.width - self.width) / 2;
+ y: (parent.height - self.height) / 2;
+ glyph: root.glyph;
+ size: root.size * 0.5;
+ tint: touch.has-hover ? Theme.on-accent : Theme.fg-muted;
+ }
+
+ touch := TouchArea {
+ mouse-cursor: pointer;
+ clicked => { root.clicked(); }
+ }
+}
+
+// One sound: a play button on the audio colour, the name and the length,
+// the envelope, and the plus. A click anywhere plays it; a drag lays it on
+// the lanes; the plus lays it at the playhead. A sound of the user's own
+// has a cross, under the pointer, that takes it out of the library.
+export component SoundRow inherits Rectangle {
+ in property <SoundCardData> item;
+ /// A phone's row: taller, for a finger, and not a drag source - a
+ /// finger on a row is a scroll, and the sheet lies over the lanes.
+ in property <bool> touch-sized;
+
+ callback preview();
+ callback add();
+ callback remove();
+
+ property <bool> playing-row: SourcePreview.card == root.item.id && root.item.id != "";
+ property <bool> playing: root.playing-row && SourcePreview.playing;
+ property <string> payload: root.touch-sized || !root.item.ready ? ""
+ : "sound:\{root.item.id}:\{root.item.name}";
+
+ height: root.touch-sized ? 56px : 44px;
+ border-radius: Theme.r;
+ background: root.playing-row ? Theme.field-active
+ : card.has-hover ? Theme.field : Colors.transparent;
+ opacity: drag.dragging ? 0.45 : 1.0;
+
+ animate background { duration: 100ms; easing: cubic-bezier(0.4, 0, 0.2, 1); }
+
+ drag := DragArea {
+ data: Payload.of(root.payload);
+ drag-image: Payload.preview(root.payload);
+ drag-image-offset-x: -8;
+ drag-image-offset-y: -4;
+ allow-copy: true;
+
+ card := TouchArea {
+ mouse-cursor: pointer;
+ clicked => { root.preview(); }
+ double-clicked => { if (root.item.ready) { root.add(); } }
+
+ HorizontalLayout {
+ padding-left: 6px;
+ padding-right: 6px;
+ spacing: 8px;
+
+ VerticalLayout {
+ alignment: center;
+ Rectangle {
+ width: root.touch-sized ? 40px : 32px;
+ height: self.width;
+ border-radius: Theme.r-sm;
+ background: Theme.kind-audio-well;
+
+ Icon {
+ x: (parent.width - self.width) / 2;
+ y: (parent.height - self.height) / 2;
+ glyph: root.playing ? Glyph.pause
+ : (card.has-hover || root.touch-sized) ? Glyph.play
+ : Glyph.music;
+ size: parent.width * 0.42;
+ tint: Theme.kind-audio;
+ }
+ }
+ }
+
+ VerticalLayout {
+ horizontal-stretch: 1;
+ alignment: center;
+ spacing: 2px;
+
+ Text {
+ text: root.item.name;
+ color: Theme.fg;
+ font-size: root.touch-sized ? Theme.fs : Theme.fs-sm;
+ overflow: elide;
+ }
+ Text {
+ text: root.item.detail == "" ? Fmt.short-duration(root.item.duration)
+ : "\{Fmt.short-duration(root.item.duration)} · \{root.item.detail}";
+ color: Theme.fg-dim;
+ font-family: Theme.font-technical;
+ font-size: Theme.fs-xs;
+ overflow: elide;
+ }
+ }
+
+ if root.item.wave != "": VerticalLayout {
+ alignment: center;
+ Wave {
+ width: root.touch-sized ? 56px : 64px;
+ height: 22px;
+ commands: root.item.wave;
+ tint: root.playing-row ? Theme.kind-audio : Theme.kind-audio.with-alpha(0.6);
+ }
+ }
+
+ if root.removable-shown: VerticalLayout {
+ alignment: center;
+ RowButton {
+ glyph: Glyph.trash;
+ danger: true;
+ size: root.touch-sized ? 32px : 22px;
+ clicked => { root.remove(); }
+ }
+ }
+
+ VerticalLayout {
+ alignment: center;
+ RowButton {
+ glyph: Glyph.plus;
+ size: root.touch-sized ? 32px : 22px;
+ clicked => { root.add(); }
+ }
+ }
+ }
+
+ // How far the one playing has got, as a line along its foot.
+ if root.playing-row: Rectangle {
+ x: 0;
+ y: parent.height - 2px;
+ width: parent.width * Math.clamp(SourcePreview.progress, 0, 1);
+ height: 2px;
+ background: Theme.accent;
+ }
+ }
+ }
+
+ /// The cross is shown under the pointer on a desk, where a permanent
+ /// one on every row is a list's worth of invitations to lose a sound,
+ /// and always on a phone, which has no pointer to be under.
+ property <bool> removable-shown: root.item.removable && (card.has-hover || root.touch-sized);
+}
+
+// The rows of a shelf, one under another.
+export component SoundList inherits VerticalLayout {
+ in property <[SoundCardData]> items;
+ in property <bool> touch-sized;
+ /// A row's sound went onto the timeline: a phone's sheet goes down.
+ callback added(id: string);
+
+ spacing: 2px;
+
+ for entry in root.items: SoundRow {
+ item: entry;
+ touch-sized: root.touch-sized;
+ preview => { Sounds.preview(entry.id); }
+ add => {
+ Sounds.add(entry.id);
+ root.added(entry.id);
+ }
+ remove => { Sounds.remove(entry.id); }
+ }
+}
diff --git a/src/crates/concat/ui/workspace/media-pane.slint b/src/crates/concat/ui/workspace/media-pane.slint
index 43d73586..f5011912 100644
--- a/src/crates/concat/ui/workspace/media-pane.slint
+++ b/src/crates/concat/ui/workspace/media-pane.slint
@@ -12,9 +12,14 @@ import { SearchField } from "../inspector/controls.slint";
import { Select } from "../primitives/select.slint";
import { Wave } from "../primitives/wave.slint";
import { ContextMenu, MenuItemData } from "../primitives/context-menu.slint";
+import { SourcePreview } from "source-preview.slint";
+import { Sounds, SoundList } from "audio-page.slint";
+
+export { SourcePreview }
// The library pane: a strip of pages across the top, then a narrow category
-// sidebar and the browsing area beside it. Media is the bin; Text adds a
+// sidebar and the browsing area beside it. Media is the bin; Audio keeps
+// the user's own sounds across projects; Text adds a
// title; Transitions, Effects and Filters each browse a catalogue;
// Adjustments lays a layer that grades everything beneath it and keeps the
// user's LUTs; Templates saves the project as one.
@@ -27,24 +32,6 @@ export enum MediaKind { video, audio, image }
/// shelf: what the editor read aloud, which the Media rows leave out.
export enum MediaFilter { all, video, audio, images, speech, processed }
-/// The library file lent to the monitor and the speakers, published by
-/// Rust (see concat's source.rs): its card shows how far it has played,
-/// the monitor names it, and its transport runs through it.
-export global SourcePreview {
- in property <bool> open;
- in property <string> name;
- /// The card's row, or -1.
- in property <int> row: -1;
- in property <float> time;
- in property <float> duration;
- in property <float> progress;
- in property <bool> playing;
- /// The monitor's chip was closed: the timeline has it back.
- callback closed();
- /// The monitor's timecode moved through the source.
- callback seek(seconds: float);
-}
-
/// One look a title can be given, as the Text page's Presets shelf shows
/// it: enough of the style to draw the name in it. Published by Rust from
/// the preset list; the id is what is placed, and ids are stable for ever
@@ -1808,6 +1795,12 @@ export component MediaPane inherits Rectangle {
callback pane-removed();
property <int> tab;
+ /// The Audio page is up, or not: a drop of sound files on the window
+ /// goes into the library while it is.
+ changed tab => { Sounds.shown(root.tab == 8); }
+ /// The Audio page's shelf: 0 = Mine.
+ property <int> audio-category;
+ property <bool> sounds-open: true;
/// How far left the page strip can be pushed: nothing, while its chips
/// fit. See `strip`.
property <length> strip-floor: Math.min(0px, strip.width - strip.content-width);
@@ -1932,6 +1925,14 @@ export component MediaPane inherits Rectangle {
current: root.tab == 0;
clicked => { root.tab = 0; }
}
+ // Beside Media, where CapCut keeps it: the page
+ // number is the last one handed out, not the place.
+ LibraryTab {
+ glyph: Glyph.music;
+ label: I18n.t("common.audio");
+ current: root.tab == 8;
+ clicked => { root.tab = 8; }
+ }
LibraryTab {
glyph: Glyph.text-mark;
label: I18n.t("common.text");
@@ -2141,6 +2142,24 @@ export component MediaPane inherits Rectangle {
}
}
+ // Audio: the user's own sounds.
+ if root.tab == 8: VerticalLayout {
+ spacing: 1px;
+ CategoryHeading {
+ height: 26px;
+ title: I18n.t("sounds.sounds");
+ open: root.sounds-open;
+ toggled => { root.sounds-open = !root.sounds-open; }
+ }
+ if root.sounds-open: CategoryRow {
+ height: 24px;
+ label: I18n.t("sounds.mine");
+ count: Sounds.mine.length;
+ current: root.audio-category == 0;
+ clicked => { root.audio-category = 0; }
+ }
+ }
+
if root.tab == 1: VerticalLayout {
spacing: 1px;
CategoryHeading {
@@ -2453,6 +2472,34 @@ export component MediaPane inherits Rectangle {
}
}
+ // Mine: the user's own sounds, copied in and kept across
+ // projects. The import is the page's head, and its rows
+ // are the sounds, newest first.
+ if root.tab == 8 && root.audio-category == 0: VerticalLayout {
+ padding: 8px;
+ spacing: 8px;
+
+ ImportButton {
+ label: I18n.t("sounds.importSounds");
+ busy: Sounds.importing;
+ clicked => { Sounds.import(); }
+ }
+ if Sounds.mine.length > 0: Text {
+ text: I18n.t("sounds.mineHint");
+ color: Theme.fg-muted;
+ font-size: Theme.fs-sm;
+ wrap: word-wrap;
+ }
+ SoundList {
+ items: Sounds.mine;
+ }
+ }
+
+ if root.tab == 8 && root.audio-category == 0 && Sounds.mine.length == 0: Empty {
+ glyph: Glyph.music;
+ text: I18n.t("sounds.noSoundsYet");
+ }
+
if root.tab == 1 && root.text-category == 0: HorizontalLayout {
padding: 8px;
diff --git a/src/crates/concat/ui/workspace/source-preview.slint b/src/crates/concat/ui/workspace/source-preview.slint
new file mode 100644
index 00000000..45919274
--- /dev/null
+++ b/src/crates/concat/ui/workspace/source-preview.slint
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors
+
+/// The library file lent to the monitor and the speakers, published by
+/// Rust (see concat's source.rs): its card shows how far it has played,
+/// the monitor names it, and its transport runs through it.
+export global SourcePreview {
+ in property <bool> open;
+ in property <string> name;
+ /// The card's row, or -1.
+ in property <int> row: -1;
+ /// The Audio page's card playing, or empty for a file in the bin.
+ in property <string> card;
+ in property <float> time;
+ in property <float> duration;
+ in property <float> progress;
+ in property <bool> playing;
+ /// The monitor's chip was closed: the timeline has it back.
+ callback closed();
+ /// The monitor's timecode moved through the source.
+ callback seek(seconds: float);
+}