Closed Bug 2010427 Opened 3 months ago Closed 2 months ago

Changing original media element volume and mute should not affect audio captured through captureStream()

Categories

(Core :: Audio/Video: MediaStreamGraph, defect, P2)

defect

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox149 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-complete)

Attachments

(7 files, 1 obsolete file)

STR.

  1. go to https://jsfiddle.net/drqLhbx8/1/ (it needs bug 2007596 and pref media.captureStream.enabled=true)
  2. start video
  3. press start captureStream button
  4. mute the original video

Expected.
5. the new video is still audible

Actual.
5. the new video becomes muted as well

This is defined in the spec.

See Also: → 966247

Note that MediaElementAudioSourceNode should apply volume, so if used in combination with captureStream you should end up with some tracks with applied volume and some without.

Summary: Changing original media element volume and mute should not affect captured audio → Changing original media element volume and mute should not affect audio captured through captureStream()
Attachment #9538883 - Attachment description: WIP: Bug 2010427 - apply volume to different tracks based on situations. → WIP: Bug 2010427 - part1 : apply volume to different tracks based on situations.
Attachment #9538883 - Attachment description: WIP: Bug 2010427 - part1 : apply volume to different tracks based on situations. → Bug 2010427 - part1 : apply volume to different tracks based on situations.
Attachment #9538917 - Attachment description: WIP: Bug 2010427 - part2 : add test to ensure HTMLMediaElement volume changes are reflected correctly in Web Audio and capture outputs. → Bug 2010427 - part2 : add test to ensure HTMLMediaElement volume changes are reflected correctly in Web Audio and capture outputs.
Attachment #9538883 - Attachment description: Bug 2010427 - part1 : apply volume to different tracks based on situations. → Bug 2010427 - part1 : monitor media element's effective volume in order to apply volume change on the media element source node properly.
Attachment #9538917 - Attachment description: Bug 2010427 - part2 : add test to ensure HTMLMediaElement volume changes are reflected correctly in Web Audio and capture outputs. → Bug 2010427 - part2 : no longer apply volume on AudioDecoderInputTrack.
Attachment #9540139 - Attachment description: Bug 2010427 - part3 : add a WPT to verify MediaElementAudioSourceNode output reflects HTMLMediaElement effective volume change. → Bug 2010427 - part2 : add a WPT to verify MediaElementAudioSourceNode output reflects HTMLMediaElement effective volume change.
Attachment #9540173 - Attachment description: Bug 2010427 - part4 : add a WPT to verify captured audio from captureStream is unaffected by its source element's effective volume change. → Bug 2010427 - part3 : add a WPT to verify captured audio from captureStream is unaffected by its source element's effective volume change.
Attachment #9538917 - Attachment is obsolete: true
See Also: → 1864067
  1. Play "MediaElementAudioSourceNode" element.
  2. Mute "MediaElementAudioSourceNode" element.

Expect: no audio output.
Actual: audio output.

https://phabricator.services.mozilla.com/D279751?id=1194910 fixes this.

Would be good to capture these behavior changes in release notes for developers.
To summarize:

  • MediaElementAudioSourceNode will now capture audio at the media element's volume also when the media element is playing a MediaStream, per spec.
  • mozCaptureStream (and soon captureStream) will capture audio without applying the media element's volume, regardless of the type of source the media element is playing, per spec.
Keywords: dev-doc-needed
Attachment #9542238 - Attachment description: Bug 2010427 - part4 : use script processor node to update the way of computing RMS for loopback test. → Bug 2010427 - part4 : switch RMS measurement to ScriptProcessorNode and add volume tests.
Blocks: 2014859

Window audio capture now captures all audio sources at full volume,
regardless of the mute state of individual elements. We will address
this problem further in bug 1864067.

Update the test to expect 5 frequency peaks instead of 3 (including
the muted elements)

Attachment #9543033 - Attachment description: Bug 2010427 - part6 : update test_getUserMedia_audioCapture to expect muted elements are captured. → Bug 2010427 - part6 : update TODO for test_getUserMedia_audioCapture.
Attachment #9543033 - Attachment description: Bug 2010427 - part6 : update TODO for test_getUserMedia_audioCapture. → Bug 2010427 - part6 : update test_getUserMedia_audioCapture.
Pushed by alwu@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e0f4d3e044ca https://hg.mozilla.org/integration/autoland/rev/8cd32254da8d part1 : monitor media element's effective volume in order to apply volume change on the media element source node properly. r=media-playback-reviewers,pehrsons,karlt https://github.com/mozilla-firefox/firefox/commit/15f528f3afeb https://hg.mozilla.org/integration/autoland/rev/c23e57301169 part2 : add a WPT to verify MediaElementAudioSourceNode output reflects HTMLMediaElement effective volume change. r=pehrsons,karlt https://github.com/mozilla-firefox/firefox/commit/935e4940963e https://hg.mozilla.org/integration/autoland/rev/4adc67f8f311 part3 : add a WPT to verify captured audio from captureStream is unaffected by its source element's effective volume change. r=pehrsons https://github.com/mozilla-firefox/firefox/commit/ec3af719c70a https://hg.mozilla.org/integration/autoland/rev/4ae77e6a4810 part4 : switch RMS measurement to ScriptProcessorNode and add volume tests. r=pehrsons https://github.com/mozilla-firefox/firefox/commit/afdb83876aa4 https://hg.mozilla.org/integration/autoland/rev/cd257972a761 part5 : add a loopback test for MediaElementAudioSourceNode. r=pehrsons https://github.com/mozilla-firefox/firefox/commit/894cf1a51c74 https://hg.mozilla.org/integration/autoland/rev/0455c603ae10 part6 : update test_getUserMedia_audioCapture. r=webrtc-reviewers,pehrsons
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/57700 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot

FF149 MDN work for this can be tracked in https://github.com/mdn/content/issues/43215 (was https://github.com/mdn/content/issues/43213)

What documentation did you think should be done?
Support for non-prefixed HTMLMediaElement.captureStream() only came in the same release. So to me this looks like (part of the) "Implementation of that method as you would expect from the specification". So not planning on capturing this.

But if there is specific developer-facing information that needs to be conveyed, please let me know!

Flags: needinfo?(alwu)

See comment 8. So mainly developer release notes and that this affects MediaElementAudioSourceNode as well.

Flags: needinfo?(alwu)

Thank you. This will be captured in https://github.com/mdn/content/pull/43349

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: