Skip to content
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

AudioInputId is not passed into MicAudioSource when making a new audio configuration #96

Closed
corinagum opened this issue Oct 21, 2019 · 9 comments

Comments

@corinagum
Copy link

https://github.com/microsoft/cognitive-services-speech-sdk-js/blob/master/src/sdk/Audio/AudioConfig.ts#L40

Hi, I'm reporting from the Bot Framework Web Chat team.

When passing in the deviceId to the AudioConfig.fromMicrophoneInput, it looks like deviceId is being passed as the audioSourceId into the MicAudioSource.

This is causing bugs for Web Chat when attempting to manually set the audio source. We pass the deviceId in, but it continues to use the default device.

@compulim
Copy link
Contributor

@rhurey Could you take a look at this? It is affecting one of our customers, preventing them to use AirPods on iPhone for Cognitive Services because iPhone did not set AirPods as their default microphone.

@rhurey
Copy link
Member

rhurey commented Dec 13, 2019

I took a quick look this morning, and when I have my Surface Headphones (Sorry, don't have AirPods) connected to my iphone the navigator.mediaDevices.enumerateDevices() device enumeration only returns a single device, an iPhone Microphone, but it does take audio from the headphones.

Where did you get the device id for the AirPods?

@rhurey
Copy link
Member

rhurey commented Jan 7, 2020

I managed to get a set of AirPods to try with also, and the device enumeration still only returns a single device.

So I'm still looking for where you got a device ID from?

@cwhitten
Copy link
Member

cwhitten commented Jan 7, 2020

@rhurey that's odd. you should see at least the built-in audio id and the airpods id.

@corinagum
Copy link
Author

I have a sample that shows the manual fix: https://github.com/corinagum/WebChat-Samples

Run npx serve from the root and go to http://localhost:5000/audioconfig/ to test the sample

The line I modified in the Speech SDK bundle was 3036 (added the null for third parameter)

In my screencap below, the deviceId starting '225'.. represents my Airpods. There is a list of 11 devices, and from there I filtered out the non-audioinput items. The dropdown on the sample let's you choose the device.

image

@rhurey
Copy link
Member

rhurey commented Jan 16, 2020

Odd indeed. I changed the media label seeking code in the SDK's microphone to dump the audio devices and got far less.

navigator.mediaDevices.enumerateDevices().then((devices: MediaDeviceInfo[]) => {

Array (3)
0 MediaDeviceInfo {deviceId: "D0096C92FAAE60D3FFC0D2896FC1925E79ECEA21", kind: "audioinput", label: "iPhone Microphone", groupId: "", toJSON: function}
1 MediaDeviceInfo {deviceId: "4A1DEAA6119FBCEFAE2C5C1CC053742A6CEE4915", kind: "videoinput", label: "Front Camera", groupId: "", toJSON: function}
2 MediaDeviceInfo {deviceId: "D8EC54A72CFAE4FBACD9A59ADE27C45005CA0D65", kind: "videoinput", label: "Back Camera", groupId: "", toJSON: function}

@compulim
Copy link
Contributor

  1. Do you see AirPod when you go to this page? https://webrtc.github.io/samples/src/content/devices/input-output/
  2. Are you playing music with Bluetooth while you are enumerating? Playing audio thru A2DP could temporarily disable HFP/HSP.

@rhurey
Copy link
Member

rhurey commented Jan 16, 2020

  1. No. But they're what the page is using. I can set the phone down and walk away while still hearing myself.

  2. Not intentionally.

@rhurey
Copy link
Member

rhurey commented Feb 12, 2020

Fix will be in our next release. Closing.

@rhurey rhurey closed this as completed Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants