Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b6e81a21d | |||
| 801a182e7c | |||
| bc20cf825d |
+11
-4
@@ -10,18 +10,25 @@ use crate::imp::SpawnHandle;
|
|||||||
|
|
||||||
#[cfg(not(feature = "embed-denoiser"))]
|
#[cfg(not(feature = "embed-denoiser"))]
|
||||||
async fn denoiser_model_bytes() -> color_eyre::Result<Cow<'static, [u8]>> {
|
async fn denoiser_model_bytes() -> color_eyre::Result<Cow<'static, [u8]>> {
|
||||||
|
use color_eyre::eyre::eyre;
|
||||||
use manganis::{asset, Asset};
|
use manganis::{asset, Asset};
|
||||||
|
|
||||||
static DF_MODEL: Asset = asset!("/assets/DeepFilterNet3_ll_onnx.tar.gz");
|
static DF_MODEL: Asset = asset!("/assets/DeepFilterNet3_ll_onnx.tar.gz");
|
||||||
let bytes = dioxus_asset_resolver::read_asset_bytes(&DF_MODEL.to_string()).await?;
|
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))
|
Ok(Cow::Owned(bytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "embed-denoiser")]
|
#[cfg(feature = "embed-denoiser")]
|
||||||
async fn denoiser_model_bytes() -> color_eyre::Result<Cow<'static, [u8]>> {
|
async fn denoiser_model_bytes() -> color_eyre::Result<Cow<'static, [u8]>> {
|
||||||
static DF_MODEL: &[u8] =
|
static DF_MODEL: &[u8] = include_bytes!(concat!(
|
||||||
include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/DeepFilterNet3_ll_onnx.tar.gz"));
|
env!("CARGO_MANIFEST_DIR"),
|
||||||
|
"/assets/DeepFilterNet3_ll_onnx.tar.gz"
|
||||||
|
));
|
||||||
Ok(Cow::Borrowed(DF_MODEL))
|
Ok(Cow::Borrowed(DF_MODEL))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: make this user configurable.
|
// TODO: make this user configurable.
|
||||||
static DEFAULT_NOISE_FLOOR: f32 = 0.001;
|
static DEFAULT_NOISE_FLOOR: f32 = 0.001;
|
||||||
// 200ms hold at 48kHz sample rate
|
// 200ms hold at 48kHz sample rate
|
||||||
@@ -60,7 +67,7 @@ fn with_denoising_model<O>(spawn: &SpawnHandle, func: impl FnOnce(&mut DfTract)
|
|||||||
let model_bytes = match denoiser_model_bytes().await {
|
let model_bytes = match denoiser_model_bytes().await {
|
||||||
Ok(b) => b,
|
Ok(b) => b,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("could not read denoising model: {e:?}");
|
error!("{e}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ pub async fn network_connect(
|
|||||||
username: String,
|
username: String,
|
||||||
event_rx: &mut UnboundedReceiver<Command>,
|
event_rx: &mut UnboundedReceiver<Command>,
|
||||||
overrides: &ProxyOverrides,
|
overrides: &ProxyOverrides,
|
||||||
state: SharedState,
|
state: SharedState<impl Reactivity>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
info!("connecting");
|
info!("connecting");
|
||||||
|
|
||||||
|
|||||||
@@ -9,3 +9,5 @@ pub use imp::*;
|
|||||||
pub use mainloop::*;
|
pub use mainloop::*;
|
||||||
pub use mime_guess;
|
pub use mime_guess;
|
||||||
pub use reqwest;
|
pub use reqwest;
|
||||||
|
|
||||||
|
pub const VERSION: Option<&str> = option_env!("MUMBLE_WEB2_VERSION");
|
||||||
|
|||||||
+3
-6
@@ -3,12 +3,10 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use mumble_web2_client::{
|
use mumble_web2_client::{
|
||||||
network_entrypoint, reqwest, AudioSettings, ChannelId, Command, ConfigSystem,
|
network_entrypoint, reqwest, AudioSettings, ChannelId, Command, ConfigSystem,
|
||||||
ConfigSystemInterface as _, ConnectionState, Platform, PlatformInterface as _, ServerState,
|
ConfigSystemInterface as _, ConnectionState, Platform, PlatformInterface as _, UserId,
|
||||||
UserId, UserState,
|
UserState, VERSION,
|
||||||
};
|
};
|
||||||
use mumble_web2_common::{ProxyOverrides, ServerStatus};
|
use mumble_web2_common::{ProxyOverrides, ServerStatus};
|
||||||
use std::collections::{HashMap, HashSet};
|
|
||||||
use std::{fmt, sync::Arc};
|
|
||||||
use Command::*;
|
use Command::*;
|
||||||
use ConnectionState::*;
|
use ConnectionState::*;
|
||||||
|
|
||||||
@@ -595,13 +593,12 @@ pub fn LoginView(overrides: Resource<ProxyOverrides>) -> Element {
|
|||||||
),
|
),
|
||||||
Connected => unreachable!(),
|
Connected => unreachable!(),
|
||||||
};
|
};
|
||||||
let version = option_env!("MUMBLE_WEB2_VERSION");
|
|
||||||
rsx!(
|
rsx!(
|
||||||
div {
|
div {
|
||||||
class: "login",
|
class: "login",
|
||||||
h1 {
|
h1 {
|
||||||
"Mumble Web"
|
"Mumble Web"
|
||||||
match version {
|
match VERSION {
|
||||||
Some(v) => rsx!(" " span { class: "login_version", "({v})" }),
|
Some(v) => rsx!(" " span { class: "login_version", "({v})" }),
|
||||||
None => rsx!(),
|
None => rsx!(),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user