You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+19-15Lines changed: 19 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -752,7 +752,7 @@ enum AudioContextState {
752
752
"<dfn>interrupted</dfn>"
753
753
<td>
754
754
This context is currently interrupted and cannot process audio
755
-
until the interruption ends.
755
+
until the [=interruption=] ends.
756
756
</table>
757
757
</div>
758
758
@@ -1972,37 +1972,36 @@ Methods</h4>
1972
1972
2. Let <var>promise</var> be a new Promise.
1973
1973
1974
1974
3. If the {{[[control thread state]]}} on the
1975
-
{{AudioContext}} is <code>closed</code> or <code>interrupted</code> reject the
1975
+
{{AudioContext}} is <code>closed</code> reject the
1976
1976
promise with {{InvalidStateError}}, abort these steps,
1977
1977
returning <var>promise</var>.
1978
1978
1979
1979
4. Set {{[[suspended by user]]}} to <code>false</code>.
1980
1980
1981
-
4. If the {{BaseAudioContext/state}} attribute of the {{AudioContext}} is "{{AudioContextState/suspended}}" and the {{[[control thread state]]}} on the
1982
-
{{AudioContext}} is <code>interrupted</code>:
1981
+
5. If the {{[[control thread state]]}} on the
1982
+
{{AudioContext}} is <code>suspended</code> and there is an ongoing [=interruption=]:
1983
+
1984
+
1. Queue a media element task</a> to execute the following steps:
queue a media element task</a> to execute the following steps:
1986
-
1987
1986
1. Set the {{BaseAudioContext/state}} attribute of the {{AudioContext}} to "{{AudioContextState/interrupted}}".
1988
1987
1989
1988
2. [=Queue a media element task=] to [=fire an event=] named
1990
1989
{{BaseAudioContext/statechange}} at the {{AudioContext}}.
1991
-
1990
+
1992
1991
2. Reject the promise with {{InvalidStateError}}, abort these steps,
1993
1992
returning <var>promise</var>.
1994
1993
1995
-
5. If the context is not <a>allowed to start</a>, append
1994
+
6. If the context is not <a>allowed to start</a>, append
1996
1995
<var>promise</var> to {{BaseAudioContext/[[pending promises]]}} and
1997
1996
{{AudioContext/[[pending resume promises]]}} and abort these steps, returning
1998
1997
<var>promise</var>.
1999
1998
2000
-
6. Set the {{[[control thread state]]}} on the
1999
+
7. Set the {{[[control thread state]]}} on the
2001
2000
{{AudioContext}} to <code>running</code>.
2002
2001
2003
-
7. <a>Queue a control message</a> to resume the {{AudioContext}} with <var>promise</var>.
2002
+
8. <a>Queue a control message</a> to resume the {{AudioContext}} with <var>promise</var>.
2004
2003
2005
-
8. Return <var>promise</var>.
2004
+
9. Return <var>promise</var>.
2006
2005
</div>
2007
2006
2008
2007
<div id="context-resume" algorithm="run a control message in AudioContext">
@@ -11984,6 +11983,11 @@ buffer</a> and the value(s) of the {{AudioParam}}(s) of this
11984
11983
11985
11984
<h3 id="interruption-handling">Handling an interruption on the {{AudioContext}}</h3>
11986
11985
11986
+
An <dfn>interruption</dfn> is an event generated by the user agent when it needs to halt audio playback for
11987
+
an {{AudioContext}}. For example, The user agent may create an interruption when another application
11988
+
requests exclusive access to the audio output hardware. This could happen when there is an incoming
11989
+
call from a VoIP application.
11990
+
11987
11991
The {{AudioContext}} |audioContext| performs the following steps on the <a>rendering thread</a> when an interruption happens.
11988
11992
11989
11993
1. If the |audioContext|'s {{[[rendering thread state]]}} is <code>closed</code> or <code>interrupted</code>:
@@ -12010,13 +12014,13 @@ The {{AudioContext}} |audioContext| performs the following steps on the <a>rende
12010
12014
12011
12015
Note: If the {{AudioContext}} is <code>suspended</code> a {{BaseAudioContext/statechange}} event is not fired for privacy reasons to avoid over-sharing user activity - e.g. when a phone call comes in or when the screen gets locked.
12012
12016
12013
-
The {{AudioContext}} |audioContext| performs the following steps on the <a>rendering thread</a> when the interruption ends.
12017
+
The {{AudioContext}} |audioContext| performs the following steps on the <a>rendering thread</a> when the [=interruption=] ends.
12014
12018
12015
12019
1. If the |audioContext|'s {{[[rendering thread state]]}} is not <code>interrupted</code>:
12016
12020
12017
12021
1. Abort these steps.
12018
12022
12019
-
1. If the |audioContext|'s {{[[rendering thread state]]}} was <code>running</code> before the interruption or if the the |audioContext|'s {{[[rendering thread state]]}} was <code>suspended</code> and {{AudioContext/resume}} was called during the interruption:
12023
+
1. If the |audioContext|'s {{[[rendering thread state]]}} was <code>running</code> before the [=interruption=] or if the the |audioContext|'s {{[[rendering thread state]]}} was <code>suspended</code> and {{AudioContext/resume}} was called during the [=interruption=]:
12020
12024
12021
12025
1. Attempt to <a href="#acquiring">acquire system resources</a>.
12022
12026
@@ -12032,7 +12036,7 @@ The {{AudioContext}} |audioContext| performs the following steps on the <a>rende
12032
12036
12033
12037
1. [=Fire an event=] named {{BaseAudioContext/statechange}} at the |audioContext|.
12034
12038
12035
-
1. If the |audioContext|'s {{[[rendering thread state]]}} was <code>suspended</code> before the interruption:
12039
+
1. If the |audioContext|'s {{[[rendering thread state]]}} was <code>suspended</code> before the [=interruption=]:
12036
12040
12037
12041
1. Set the {{[[rendering thread state]]}} on the {{AudioContext}} to <code>suspended</code>.
0 commit comments