When using an AudioContext across iframes, get confusing "Connecting AudioNodes from AudioContexts with different sample-rate is currently not supported." error
Categories
(Core :: Audio/Video: MediaStreamGraph, defect, P3)
Tracking
()
Webcompat Priority | P3 |
People
(Reporter: sidney, Unassigned)
References
(Depends on 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0
Steps to reproduce:
- Open the attached example.
Actual results:
The following exception is thrown:
Uncaught DOMException: AudioContext.createMediaStreamSource: Connecting AudioNodes from AudioContexts with different sample-rate is currently not supported.
Expected results:
No exception, and a tone should be audible (but may not be, in this example).
Reporter | ||
Comment 1•4 years ago
|
||
For a little bit more context: I ran into this issue while working on a project (https://github.com/s4y/space) where I shared a single audio context among multiple components running in different, same-origin iframes. The design lets the different frames be reloaded (or new frames added and removed) independently, which has worked out great, except for turning up a bug :-).
The actual problem doesn't seem to involve sample rates, so the error message is super confusing.
I think to work around this I'll need to make a separate AudioContext per iframe.
Comment 2•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 3•4 years ago
|
||
Thank you for the quality bug report.
We could probably make this work by keying the MediaTrackGraph instances on the top WindowContext instead of the window. That would require a rethink of code that assumes one graph per window.
An alternative would be to use the inter-graph communication being developed for bug 1267161.
Improving the error message in the meantime could also be helpful.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Facing this issue as well.
We want to use AudioContext from the same-origin iframe in the host page to do audio analysis of the streams from this host page. However, AudioContext fails to create AudioNodes from capture streams.
Attaching simplified example of the previous code snippet and including getUserMedia() call. The code runs in Chrome but fails in Firefox with the following error:
Uncaught DOMException: AudioContext.createMediaStreamSource: Connecting AudioNodes from AudioContexts with different sample-rate is currently not supported.
Is it possible to prioritise this issue?
Description
•