Skip to content

Commit

Permalink
Merge pull request #76 from ircam-ismm/feature/channel-count-media
Browse files Browse the repository at this point in the history
Upgrade to 0.42, fix wpt checkout, add channelCount to MediaTrackConstraints
  • Loading branch information
b-ma authored Feb 6, 2024
2 parents 9c15161 + 1fd1e22 commit eb8984e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
7 changes: 7 additions & 0 deletions src/media_devices/get_user_media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ pub(crate) fn napi_get_user_media(ctx: CallContext) -> Result<JsObject> {
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(
Expand Down
2 changes: 1 addition & 1 deletion wpt
Submodule wpt updated 1122 files

0 comments on commit eb8984e

Please sign in to comment.