-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
channelCount constraint of getUserMedia is ignored #74
Comments
Hey, thanks for the feedback, Indeed, I don't think multi channel input is something we have really tested. Would be really nice to have, but I guess this also relates to the upstream crate and not only the bindings. I really can't assure this will be fixed in the short term as we are focusing on consolidating Web Audio spec compliance right now (...and media devices API is not per se part of the Web Audio spec). Let's keep this open as a reminder |
I opened an issue upstream |
I tested today with version web-audio-api 0.44.0 and still am only seeing 2 inputs and 2 outputs when using my multichannel interface. In this case, the interface is a Presonus StudioLive 16.0.2 USB device, which under MacOS (with no special driver installed) reports 18 inputs and 16 outputs. Here's my test code... use web_audio_api::context::AudioContext;
use web_audio_api::media_devices::{self, MediaTrackConstraints};
use web_audio_api::media_devices::MediaStreamConstraints;
use web_audio_api::node::AudioNode;
fn main() {
let context = AudioContext::default();
let devices = media_devices::enumerate_devices_sync();
for device in devices.iter() {
println!( "{}", device.label() );
let mut media_track_constraints = MediaTrackConstraints::default();
media_track_constraints.device_id = Some( device.device_id().to_string() );
media_track_constraints.channel_count = Some( 18 );
let input = media_devices::get_user_media_sync(
MediaStreamConstraints::AudioWithConstraints( media_track_constraints )
);
let stream = context.create_media_stream_source(&input);
println!( "> {}", stream.channel_count() );
}
} |
When using an audio interface with more than 2 channels, getUserMedia should be able to return a media stream with more than 2 channels by providing a channelCount constraint. Browsers generally don't support more than 2, but I was hoping since the spec does support it that this project might achieve it.
Here's some test code. One of my audio devices has 18 inputs, but it reports 2. I tired using
18
,{ exact: 18 }
and{ ideal: 18 }
as constraints, but all were ignored.The text was updated successfully, but these errors were encountered: