From a79d0621b6d7a239debb7318c2492cdb143b0a5a Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 26 Nov 2026 12:20:35 +0100 Subject: [PATCH] Upgraded webm-iterable to v0.7.1 to fix missing passages in transcripts --- .../wwwroot/changelog/v26.11.2.md | 1 + runtime/Cargo.lock | 9 ++++--- runtime/Cargo.toml | 2 +- runtime/src/media.rs | 25 +++++++++++++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/app/MindWork AI Studio/wwwroot/changelog/v26.11.2.md b/app/MindWork AI Studio/wwwroot/changelog/v26.11.2.md index 14436757c..f2ad7a435 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v26.11.2.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v26.11.2.md @@ -52,6 +52,7 @@ - Fixed the Mathematics prototype, which told the AI that a correct derivative or integral had failed its check when the values of the function were far larger than those of its derivative. - Fixed the Mathematics prototype getting stuck for a long time when it checked a result with a very large factorial or power. Meanwhile, no other calculation could run. - Fixed AI Studio ceasing to work when many files in a folder of a local data source changed within a short time, e.g., during a software build or while a sync tool updated the folder. +- Fixed transcripts of audio and video files which could miss whole passages. Before a transcription, AI Studio converts the file into a compact format, and it stored a few pieces of the sound in a way that many programs could not read. They then skipped up to half a minute of the recording at a time, so that the transcript lacked what was said there. - Upgraded several libraries to improve security. - Upgraded Tauri to v2.12.7. - Upgraded MudBlazor to v9.14.0. diff --git a/runtime/Cargo.lock b/runtime/Cargo.lock index 272c716c2..96e28f0f1 100644 --- a/runtime/Cargo.lock +++ b/runtime/Cargo.lock @@ -2113,10 +2113,11 @@ checksum = "4a742b95783b1f45b900129082cbc47717b6a77ee8d17eea70a8ea62462f5de3" [[package]] name = "ebml-iterable" -version = "0.6.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5173ac3752f08b526a6991509615e1a345b221ec3c58c7633433e8c9582312" +checksum = "152f8f4a13024011b26457b8b21040d9a9eb1222e693993ef037db391cd0c004" dependencies = [ + "bytes", "ebml-iterable-specification", "ebml-iterable-specification-derive", "futures", @@ -9015,9 +9016,9 @@ dependencies = [ [[package]] name = "webm-iterable" -version = "0.6.4" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9fbf173b4b38f2f8bbb0082a0d4cb21f263a70811f5fccb1663c421c66d9f9" +checksum = "2b1f0c637f1c2b46d58a1b42b150135f8a31b024bfdcd56cc82febfbb20ba4c0" dependencies = [ "ebml-iterable", ] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 191fa4461..bead22a5e 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -64,7 +64,7 @@ encoding_rs = "0.8.44" symphonia = { version = "0.6", default-features = false, features = ["aac", "aiff", "alac", "caf", "flac", "isomp4", "mkv", "mp1", "mp2", "mp3", "ogg", "pcm", "vorbis", "wav"] } ropus = "=0.12.18" rubato = { version = "4", default-features = false, features = ["fft_resampler"] } -webm-iterable = "0.6.4" +webm-iterable = "0.7.1" calamine = "0.37.0" # pdfium-render binds the functions of a certain PDFium version when it loads the library, and refuses a diff --git a/runtime/src/media.rs b/runtime/src/media.rs index 7e6445f5f..fd663eb19 100644 --- a/runtime/src/media.rs +++ b/runtime/src/media.rs @@ -1738,6 +1738,31 @@ mod tests { assert_eq!(clusters, 2); } + /// Verifies that every block keeps a known size. A block of exactly 127 bytes, i.e., an Opus + /// packet of 123 bytes plus the 4 bytes of the block header, must not get the size 0xFF, which + /// EBML reserves for an element of unknown size. + #[test] + fn webm_writer_keeps_the_size_of_every_block_known() { + let path = std::env::temp_dir().join(format!("ai-studio-media-block-size-{}.webm", rand::random::())); + let mut writer = WebmOpusWriter::new(File::create(&path).unwrap()).unwrap(); + for (index, packet_len) in [122, 123, 124].into_iter().enumerate() { + writer.write_packet(&vec![0xf8; packet_len], index as u64 * 960).unwrap(); + } + + writer.finish().unwrap(); + let bytes = fs::read(&path).unwrap(); + let _ = fs::remove_file(path); + let tags = WebmIterator::new(Cursor::new(bytes), &[]).collect::, _>>().unwrap(); + let block_lengths: Vec<_> = tags.iter() + .filter_map(|tag| match tag { + MatroskaSpec::SimpleBlock(block) => Some(block.len()), + _ => None, + }) + .collect(); + + assert_eq!(block_lengths, vec![126, 127, 128]); + } + /// Verifies deterministic arithmetic-mean downmixing. #[test] fn downmix_is_bounded_and_balanced() {