diff --git a/Cargo.toml b/Cargo.toml index 70361816..e12915c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,10 @@ version = "0.15.0" crate-type = ["cdylib"] [dependencies] -napi = {version="2.14", features=["napi9", "tokio_rt"]} +napi = {version="=2.14", features=["napi9", "tokio_rt"]} napi-derive = "2.14" uuid = {version="1.6.1", features = ["v4","fast-rng"]} -web-audio-api = "0.41.1" +web-audio-api = "0.42" # web-audio-api = { path = "../web-audio-api-rs" } [target.'cfg(all(any(windows, unix), target_arch = "x86_64", not(target_env = "musl")))'.dependencies] diff --git a/src/media_devices/get_user_media.rs b/src/media_devices/get_user_media.rs index de8e70c9..452ec273 100644 --- a/src/media_devices/get_user_media.rs +++ b/src/media_devices/get_user_media.rs @@ -47,6 +47,13 @@ pub(crate) fn napi_get_user_media(ctx: CallContext) -> Result { constraints.latency = Some(latency); } + if let Ok(Some(js_channel_count)) = + js_constraints.get::<&str, JsNumber>("channelCount") + { + let channel_count = js_channel_count.get_uint32()?; + constraints.channel_count = Some(channel_count); + } + MediaStreamConstraints::AudioWithConstraints(constraints) } else { return Err(napi::Error::from_reason( diff --git a/wpt b/wpt index d99b032d..51c87dc4 160000 --- a/wpt +++ b/wpt @@ -1 +1 @@ -Subproject commit d99b032d98eb39b2222e9b824a5f6cdff28c883f +Subproject commit 51c87dc4c5d4a61caef22344e4dba6f5f233ffc3