working mumble web tui
Build Mumble Web 2 / macos_build (push) Successful in 1m4s
Build Mumble Web 2 / linux_build (push) Failing after 0s
Build Mumble Web 2 / windows_build (push) Successful in 2m56s
Build Mumble Web 2 / android_build (push) Successful in 4m50s

Assisted-by: Claude:claude-opus-4-7
This commit is contained in:
2026-03-29 22:39:50 -06:00
parent d5a70cf078
commit 2692b72d5a
6 changed files with 1082 additions and 19 deletions
+1
View File
@@ -113,6 +113,7 @@ tract-onnx = "=0.12.4"
tract-pulse = "=0.12.4"
[features]
embed-denoiser = []
web = [
"wasm-bindgen",
"wasm-bindgen-futures",
+24 -6
View File
@@ -1,15 +1,34 @@
use crossbeam::atomic::AtomicCell;
use df::tract::{mut_slice_as_arrayviewmut, slice_as_arrayview};
use df::tract::{DfParams, DfTract, RuntimeParams};
use dioxus_asset_resolver::read_asset_bytes;
use manganis::{asset, Asset};
use std::borrow::Cow;
use std::cell::RefCell;
use std::sync::Arc;
use tracing::{error, info};
use crate::imp::SpawnHandle;
static DF_MODEL: Asset = asset!("/assets/DeepFilterNet3_ll_onnx.tar.gz");
#[cfg(not(feature = "embed-denoiser"))]
async fn denoiser_model_bytes() -> color_eyre::Result<Cow<'static, [u8]>> {
use color_eyre::eyre::eyre;
use manganis::{asset, Asset};
static DF_MODEL: Asset = asset!("/assets/DeepFilterNet3_ll_onnx.tar.gz");
let bytes = dioxus_asset_resolver::read_asset_bytes(&DF_MODEL.to_string())
.await
.map_err(|err| eyre!("could not read denoising model: {err}"))?;
Ok(Cow::Owned(bytes))
}
#[cfg(feature = "embed-denoiser")]
async fn denoiser_model_bytes() -> color_eyre::Result<Cow<'static, [u8]>> {
static DF_MODEL: &[u8] = include_bytes!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/assets/DeepFilterNet3_ll_onnx.tar.gz"
));
Ok(Cow::Borrowed(DF_MODEL))
}
// TODO: make this user configurable.
static DEFAULT_NOISE_FLOOR: f32 = 0.001;
// 200ms hold at 48kHz sample rate
@@ -44,12 +63,11 @@ fn with_denoising_model<O>(spawn: &SpawnHandle, func: impl FnOnce(&mut DfTract)
let cell = Arc::new(AtomicCell::new(None));
let cell_task = cell.clone();
*state = DenoisingModelState::Downloading(cell);
let model = DF_MODEL.to_string();
spawn.spawn(async move {
let model_bytes = match read_asset_bytes(&model).await {
let model_bytes = match denoiser_model_bytes().await {
Ok(b) => b,
Err(e) => {
error!("could not read denoising model from \"{model}\": {e:?}");
error!("{e}");
return;
}
};