Skip to content

Document the Audio and Video flow

Aaron Hao edited this page Nov 25, 2022 · 2 revisions

test result of invoking audioTrack.getMediaStreamTrack().getSettings() and audioTrack.getMediaStreamTrack().getConstraints():

For Chrome:

  1. passed customized microphoneDeviceId, echoCancellation, bitrate and sampleRate to create microphone track, but in result of audioTrack.getMediaStreamTrack().getSettings(), only device id is set correctly. echoCancellation result is always true, no bitrate in result, sampleRate is higher then what I pass.

The result of audioTrack.getMediaStreamTrack().getConstraints() just contains correct deviceId and sampleRate.

  1. After apply constraints manually. getSettings result doesn't change, getConstraints result does not change directly, but after several seconds, getConstraints changes.

  2. When I wait for more seconds, getSettings result still doesn't change any more.

For Firefox:

  1. Create microphone track situation: in both getSettings and getConstraints result, sampleRate and bitrate info are hidden, deviceId is right. But echoCancellation is always true in getSettings, meanwhile it's hidden in getConstraints

  2. Apply constraints situation: getSettings result keeps same, getConstraints result can not see echoCancellation directly, but after several seconds, it changes.

  3. When I wait for more seconds, echoCancellation in getSettings finally changes. Both autoGainControl and noiseSuppression changes to false with it.


conclusion: We can check current browser supported constraint list via navigator.mediaDevices.getSupportedConstraints(), for constraints that are not in the list, it doesn't work if we pass to browser.


04_51_03 04_54_34 04_55_54 05_01_25 05_04_26 05_05_59 05_11_11

Clone this wiki locally