@@ -182,6 +182,7 @@ window.addEventListener('load', (event) => {
182
182
ListAmendments("c2400", "Proposed Addition", "change-list-2400");
183
183
ListAmendments("c2512", "Proposed Addition", "change-list-2512");
184
184
ListAmendments("c2450", "Proposed Addition", "change-list-2450");
185
+ ListAmendments("c2567", "Proposed Addition", "change-list-2567");
185
186
});
186
187
</script>
187
188
<style>
@@ -1718,9 +1719,11 @@ enum AudioSinkType {
1718
1719
<a href="https://github.com/WebAudio/web-audio-api/issues/2444">Issue 2444
1719
1720
</a> Add AudioRenderCapacity Interface <br>
1720
1721
<a href="https://github.com/WebAudio/web-audio-api/issues/2400" id="c2400-2">
1721
- Issue 2400</a> Access to a different output device
1722
+ Issue 2400</a> Access to a different output device <br>
1723
+ <a href="https://github.com/WebAudio/web-audio-api/issues/2567" id="c2567-1">
1724
+ Issue 2567</a>. Device-related error reporting via AudioContext
1722
1725
<div class="amendment-buttons"></div>
1723
- <del cite="#c2444 #c2400">
1726
+ <del cite="#c2444 #c2400 #c2567 ">
1724
1727
<xmp class="idl extract" data-no-idl>
1725
1728
[Exposed=Window]
1726
1729
interface AudioContext : BaseAudioContext {
@@ -1739,7 +1742,7 @@ enum AudioSinkType {
1739
1742
};
1740
1743
</xmp>
1741
1744
</del>
1742
- <ins cite="#c2444 #2400">
1745
+ <ins cite="#c2444 #2400 #2567 ">
1743
1746
<xmp class="idl">
1744
1747
[Exposed=Window]
1745
1748
interface AudioContext : BaseAudioContext {
@@ -1749,6 +1752,7 @@ enum AudioSinkType {
1749
1752
[SecureContext] readonly attribute (DOMString or AudioSinkInfo) sinkId;
1750
1753
[SecureContext] readonly attribute AudioRenderCapacity renderCapacity;
1751
1754
attribute EventHandler onsinkchange;
1755
+ attribute EventHandler onerror;
1752
1756
AudioTimestamp getOutputTimestamp ();
1753
1757
Promise<undefined> resume ();
1754
1758
Promise<undefined> suspend ();
@@ -1968,53 +1972,90 @@ Constructors</h4>
1968
1972
Sending a <a>control message</a> to start processing means
1969
1973
executing the following steps:
1970
1974
1971
- <div class="addition proposed" id="c2400-5">
1972
- <span class="marker">Proposed Addition</span><br>
1973
- <a href="https://github.com/WebAudio/web-audio-api/issues/2400">Issue
1974
- 2400</a> Access to a different output device
1975
- <div class="amendment-buttons"></div>
1976
- <del cite=#2400>
1977
- 1. Attempt to <a href="#acquiring">acquire system resources</a>.
1978
- In case of failure, abort the following steps.
1979
-
1980
- 3. Set the {{[[rendering thread state]]}} to <code>running</code> on the {{AudioContext}}.
1975
+ <div class="addition proposed">
1976
+ <div class="addition proposed" id="c2400-5" style="border:0; margin:0; padding:0">
1977
+ <span class="marker">Proposed Addition
1978
+ <a href="https://github.com/WebAudio/web-audio-api/issues/2400">Issue 2400</a>.
1979
+ </span>
1980
+ Access to a different output device
1981
+ <div class="amendment-buttons"></div>
1982
+ </div>
1983
+ <div class="addition proposed" id="c2567-2" style="border:0; margin:0; padding:0">
1984
+ <span class="marker">Proposed Addition
1985
+ <a href="https://github.com/WebAudio/web-audio-api/issues/2567">Issue 2567</a>.
1986
+ </span>
1987
+ Device-related error reporting via AudioContext
1988
+ <div class="amendment-buttons"></div>
1989
+ </div>
1981
1990
1982
- 1. <a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task">
1983
- queue a media element task</a> to execute the following steps:
1991
+ <del cite="#2400 #2567">
1992
+ 1. Attempt to <a href="#acquiring">acquire system resources</a>.
1993
+ In case of failure, abort the following steps.
1984
1994
1985
- 1. Set the {{BaseAudioContext/ state}} attribute of the {{AudioContext}} to "{{AudioContextState/running}}" .
1995
+ 1. Set the {{[[rendering thread state]] }} to <code>running</code> on the {{AudioContext}}.
1986
1996
1987
1997
1. <a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task">
1988
- queue a media element task</a> to <a spec="dom" lt="fire an event">fire an event
1989
- </a> named {{BaseAudioContext/statechange}} at the {{AudioContext}}.
1990
- </del>
1991
- <ins cite=#2400>
1992
- 1. Attempt to <a href="#acquiring">acquire system resources</a> to use a
1993
- following audio output device based on {{AudioContext/[[sink ID]]}} for
1994
- rendering:
1998
+ queue a media element task</a> to execute the following steps:
1995
1999
1996
- * The default audio output device for the empty string.
1997
- * A audio output device identified by {{AudioContext/[[sink ID]]}}.
1998
-
1999
- In case of failure, abort the following steps.
2000
+ 1. Set the {{BaseAudioContext/state}} attribute of the {{AudioContext}} to "{{AudioContextState/running}}".
2000
2001
2001
- 1. Set the {{[[rendering thread state]]}} to <code>running</code> on the
2002
- {{AudioContext}}.
2002
+ 1. [=Queue a media element task=] to [=fire an event=] named
2003
+ {{BaseAudioContext/statechange}} at the {{AudioContext}}.
2003
2004
2004
- 1. <a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task">
2005
- Queue a media element task</a> to execute the following steps:
2005
+ </del>
2006
+ <ins cite="#2400 #2567">
2007
+ 1. Let |document| be the [=current settings object=]'s [=relevant global object=]'s
2008
+ [=associated Document=].
2006
2009
2007
- 1. Set the {{BaseAudioContext/state}} attribute of the {{AudioContext}}
2008
- to "{{AudioContextState/running}}".
2010
+ 1. Attempt to [=acquire system resources=] to use a following audio output device
2011
+ based on {{AudioContext/[[sink ID]]}} for rendering:
2009
2012
2010
- 1. <a spec="dom" lt="fire an event">Fire an event</a> named
2011
- {{BaseAudioContext/statechange}} at the {{AudioContext}}.
2012
- </ins>
2013
+ * The default audio output device for the empty string.
2014
+ * A audio output device identified by {{AudioContext/[[sink ID]]}}.
2015
+
2016
+ 1. If resource acquisition fails, execute the following steps:
2017
+
2018
+ 1. If |document| is not allowed to use the feature identified by
2019
+ <code>"speaker-selection"</code>, abort these substeps.
2020
+
2021
+ 1. [=queue a media element task=] to [=fire an event=] using {{ErrorEvent}}
2022
+ at the {{AudioContext/error}} of the {{AudioContext}}, and abort the
2023
+ following steps.
2024
+
2025
+ 1. Set [=this=] {{[[rendering thread state]]}} to <code>running</code> on the
2026
+ {{AudioContext}}.
2027
+
2028
+ 1. [=Queue a media element task=] to execute the following steps:
2029
+
2030
+ 1. Set the {{BaseAudioContext/state}} attribute of the {{AudioContext}}
2031
+ to "{{AudioContextState/running}}".
2032
+
2033
+ 1. [=fire an event=] named {{BaseAudioContext/statechange}} at the
2034
+ {{AudioContext}}.
2035
+ </ins>
2036
+
2037
+ </div>
2013
2038
</div>
2039
+
2040
+ <div class="proposed addition" id="c2567-3">
2041
+ <span class="marker">Proposed Addition
2042
+ <a href="https://github.com/WebAudio/web-audio-api/issues/2567">Issue 2567</a>.
2043
+ </span>
2044
+ Device-related error reporting via AudioContext
2045
+ <div class="amendment-buttons"></div>
2046
+ <del>
2014
2047
Note: It is unfortunately not possible to programatically notify authors
2015
2048
that the creation of the {{AudioContext}} failed. User-Agents are
2016
2049
encouraged to log an informative message if they have access to a logging
2017
2050
mechanism, such as a developer tools console.
2051
+ </del>
2052
+ <ins>
2053
+ NOTE: In cases where an {{AudioContext}} is constructed with no arguments and resource
2054
+ acquisition fails, the User-Agent will attempt to silently render the audio graph using
2055
+ a mechanism that emulates an audio output device.
2056
+ </ins>
2057
+ </div>
2058
+
2018
2059
</div>
2019
2060
2020
2061
<div class="addition proposed" id="c2456-2">
@@ -2111,10 +2152,8 @@ Attributes</h4>
2111
2152
2444</a>.
2112
2153
</span>
2113
2154
Add AudioRenderCapacity Interface
2114
- <div class="amendment-buttons">
2115
- Buttons here
2116
- </div>
2117
- <ins cite=#c2444>
2155
+ <div class="amendment-buttons"></div>
2156
+ <ins cite=#c2444>
2118
2157
: <dfn>renderCapacity</dfn>
2119
2158
::
2120
2159
Returns an {{AudioRenderCapacity}} instance associated with
@@ -2146,7 +2185,30 @@ Attributes</h4>
2146
2185
is available to check the readiness of the initial output device.
2147
2186
2148
2187
</ins>
2149
- </dl>
2188
+ </div>
2189
+
2190
+ <div class="proposed addition" id="c2567-4">
2191
+ <span class="marker">Proposed Addition
2192
+ <a href="https://github.com/WebAudio/web-audio-api/issues/2567">Issue 2567</a>.
2193
+ </span>
2194
+ Device-related error reporting via AudioContext
2195
+ <div class="amendment-buttons"></div>
2196
+ <ins cite=#2567>
2197
+ : <dfn>onerror</dfn>
2198
+ ::
2199
+ An [=event handler=] for the {{ErrorEvent}} dispatched from an {{AudioContext}}. The event
2200
+ type of this handler is <dfn event for=AudioContext>error</dfn> and the user agent can
2201
+ dispatch this event in the following cases:
2202
+
2203
+ * When initializing and activating a selected audio device encounters failures.
2204
+ * When the audio output device associated with an {{AudioContext}} is disconnected while
2205
+ the context is {{AudioContextState/running}}.
2206
+ * When the operating system reports an audio device malfunction.
2207
+
2208
+ </ins>
2209
+ </div>
2210
+
2211
+ </dl>
2150
2212
2151
2213
<h4 id="AudioContext-methods">
2152
2214
Methods</h4>
@@ -12864,6 +12926,54 @@ running the algorithm for an {{AudioNode}}, using an <a>input
12864
12926
buffer</a> and the value(s) of the {{AudioParam}}(s) of this
12865
12927
{{AudioNode}} as the input for this algorithm.
12866
12928
12929
+
12930
+ <div class="addition proposed" id="c2567-5">
12931
+ <span class="marker">Proposed addition
12932
+ <a href="https://github.com/WebAudio/web-audio-api/issues/2567">Issue 2567</a>.
12933
+ </span>
12934
+ Device-related error reporting via AudioContext
12935
+ <div class="amendment-buttons"></div>
12936
+ <ins>
12937
+
12938
+ <h3 id="error-handling-on-a-running-audio-context">
12939
+ Handling an error from System Audio Resources on the {{AudioContext}}</h3>
12940
+
12941
+ The {{AudioContext}} |audioContext| performs the following steps on <a>rendering thread</a> in the
12942
+ event of an udio system resource error.
12943
+
12944
+ 1. If the |audioContext|'s {{[[rendering thread state]]}} is <code>running</code>:
12945
+
12946
+ 1. Attempt to <a>release system resources</a>.
12947
+
12948
+ 1. Set the |audioContext|'s {{[[rendering thread state]]}} to <code>suspended</code>.
12949
+
12950
+ 1. [=Queue a media element task=] to execute the following steps:
12951
+
12952
+ 1. [=Fire an event=] using {{ErrorEvent}} at the |audioContext|'s {{AudioContext/error}}.
12953
+
12954
+ 1. Set the |audioContext|'s {{[[suspended by user]]}} to <code>false</code>.
12955
+
12956
+ 1. Set the |audioContext|'s {{[[control thread state]]}} to <code>suspended</code>.
12957
+
12958
+ 1. Set the |audioContext|'s {{BaseAudioContext/state}} attribute to
12959
+ "{{AudioContextState/suspended}}".
12960
+
12961
+ 1. [=Fire an event=] at the |audioContext|'s {{BaseAudioContext/statechange}}.
12962
+
12963
+ 1. Abort these steps.
12964
+
12965
+ 1. If the |audioContext|'s {{[[rendering thread state]]}} is <code>suspended</code>:
12966
+
12967
+ 1. [=Queue a media element task=]to execute the following steps:
12968
+
12969
+ 1. [=Fire an event=] using {{ErrorEvent}} at the |audioContext|'s {{AudioContext/error}}.
12970
+
12971
+ Note: An example of system audio resource errors would be when an external or wireless audio device
12972
+ becoming disconnected during the active rendering of the {{AudioContext}}.
12973
+
12974
+ </ins>
12975
+ </div>
12976
+
12867
12977
<h3 id="unloading-a-document">Unloading a document</h3>
12868
12978
Additional <a href=
12869
12979
"https://html.spec.whatwg.org/#unloading-document-cleanup-steps">unloading
0 commit comments