Skip to content

Commit 6687f22

Browse files
committed
deploy: dfcea38
1 parent 0ab6970 commit 6687f22

2 files changed

Lines changed: 421 additions & 765 deletions

File tree

index.bs

Lines changed: 8 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,6 @@ interface AudioContext : BaseAudioContext {
14771477
readonly attribute double baseLatency;
14781478
readonly attribute double outputLatency;
14791479
[SecureContext] readonly attribute (DOMString or AudioSinkInfo) sinkId;
1480-
[SecureContext] readonly attribute AudioRenderCapacity renderCapacity;
14811480
attribute EventHandler onsinkchange;
14821481
attribute EventHandler onerror;
14831482
AudioTimestamp getOutputTimestamp ();
@@ -1725,11 +1724,6 @@ Attributes</h4>
17251724
useful to query this value frequently when accurate
17261725
synchronization is required.
17271726

1728-
: <dfn>renderCapacity</dfn>
1729-
::
1730-
Returns an {{AudioRenderCapacity}} instance associated with
1731-
an {{AudioContext}}.
1732-
17331727
: <dfn>sinkId</dfn>
17341728
::
17351729
Returns the value of {{AudioContext/[[sink ID]]}} internal slot. This
@@ -1985,7 +1979,7 @@ Methods</h4>
19851979
5. Set the {{[[control thread state]]}} on the
19861980
{{AudioContext}} to <code>running</code>.
19871981

1988-
6. <a>Queue a control message</a> to resume the {{AudioContext}}.
1982+
6. <a>Queue a control message</a> to resume the {{AudioContext}} with <var>promise</var>.
19891983

19901984
7. Return <var>promise</var>.
19911985
</div>
@@ -1995,6 +1989,8 @@ Methods</h4>
19951989
{{AudioContext}} means running these steps on the
19961990
<a>rendering thread</a>:
19971991

1992+
1. Let <var>promise</var> be the promise passed into this algorithm.
1993+
19981994
1. Attempt to <a href="#acquiring">acquire system resources</a>.
19991995

20001996
2. Set the {{[[rendering thread state]]}} on the {{AudioContext}} to <code>running</code>.
@@ -2018,7 +2014,7 @@ Methods</h4>
20182014
1. Clear {{AudioContext/[[pending resume promises]]}}. Additionally, remove those
20192015
promises from {{BaseAudioContext/[[pending promises]]}}.
20202016

2021-
2. Resolve <em>promise</em>.
2017+
2. Resolve <var>promise</var>.
20222018

20232019
3. If the {{BaseAudioContext/state}} attribute of the {{AudioContext}} is not already "{{AudioContextState/running}}":
20242020

@@ -2070,7 +2066,7 @@ Methods</h4>
20702066

20712067
5. Set the {{[[control thread state]]}} on the {{AudioContext}} to <code>suspended</code>.
20722068

2073-
6. <a>Queue a control message</a> to suspend the {{AudioContext}}.
2069+
6. <a>Queue a control message</a> to suspend the {{AudioContext}} with <var>promise</var>.
20742070

20752071
7. Return <var>promise</var>.
20762072
</div>
@@ -2080,14 +2076,16 @@ Methods</h4>
20802076
{{AudioContext}} means running these steps on the
20812077
<a>rendering thread</a>:
20822078

2079+
1. Let <var>promise</var> be the promise passed into this algorithm.
2080+
20832081
1. Attempt to <a>release system resources</a>.
20842082

20852083
2. Set the {{[[rendering thread state]]}} on the {{AudioContext}} to <code>suspended</code>.
20862084

20872085
3. <a href="https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task">
20882086
queue a media element task</a> to execute the following steps:
20892087

2090-
1. Resolve <em>promise</em>.
2088+
1. Resolve <var>promise</var>.
20912089

20922090
2. If the {{BaseAudioContext/state}}
20932091
attribute of the {{AudioContext}} is not already "{{AudioContextState/suspended}}":
@@ -2396,132 +2394,6 @@ Dictionary {{AudioTimestamp}} Members</h5>
23962394
[[!hr-time-3]]).
23972395
</dl>
23982396

2399-
<h4 interface lt="audiorenderCapacity" id="AudioRenderCapacity">
2400-
{{AudioRenderCapacity}}</h4>
2401-
2402-
<pre class="idl">
2403-
[Exposed=Window]
2404-
interface AudioRenderCapacity : EventTarget {
2405-
undefined start(optional AudioRenderCapacityOptions options = {});
2406-
undefined stop();
2407-
attribute EventHandler onupdate;
2408-
};
2409-
</pre>
2410-
2411-
This interface provides rendering performance metrics of an
2412-
{{AudioContext}}. In order to calculate them, the renderer collects a
2413-
<a>load value</a> per <a>system-level audio callback</a>.
2414-
2415-
<h5 id="AudioRenderCapacity-attributes">
2416-
Attributes</h5>
2417-
2418-
<dl dfn-type=attribute dfn-for="AudioRenderCapacity">
2419-
: <dfn>onupdate</dfn>
2420-
::
2421-
The event type of this event handler is <dfn event>update</dfn>. Events
2422-
dispatched to the event handler will use the
2423-
{{AudioRenderCapacityEvent}} interface.
2424-
</dl>
2425-
2426-
<h5 id="AudioRenderCapacity-methods">
2427-
Methods</h5>
2428-
2429-
<dl dfn-type=method dfn-for="AudioRenderCapacity">
2430-
: <dfn>start(options)</dfn>
2431-
::
2432-
Starts metric collection and analysis. This will repeatedly [=fire an event=] named
2433-
{{AudioRenderCapacity/update}} at the {{AudioRenderCapacity}}, using
2434-
{{AudioRenderCapacityEvent}}, with the given update interval in
2435-
{{AudioRenderCapacityOptions}}.
2436-
2437-
: <dfn>stop()</dfn>
2438-
::
2439-
Stops metric collection and analysis. It also stops dispatching
2440-
{{AudioRenderCapacity/update}} events.
2441-
</dl>
2442-
2443-
<h4 dictionary lt="audiorenderCapacityoptions" id="AudioRenderCapacityOptions">
2444-
{{AudioRenderCapacityOptions}}</h4>
2445-
2446-
The {{AudioRenderCapacityOptions}} dictionary can be used to provide user
2447-
options for an {{AudioRenderCapacity}}.
2448-
2449-
<pre class="idl">
2450-
dictionary AudioRenderCapacityOptions {
2451-
double updateInterval = 1;
2452-
};
2453-
</pre>
2454-
2455-
<h5 id="dictionary-AudioRenderCapacityOptions-members">
2456-
Dictionary {{AudioRenderCapacityOptions}} Members</h5>
2457-
2458-
<dl dfn-type=dict-member dfn-for="AudioRenderCapacityOptions">
2459-
: <dfn>updateInterval</dfn>
2460-
::
2461-
An update interval (in second) for dispaching
2462-
{{AudioRenderCapacityEvent}}s. A <a>load value</a> is calculated
2463-
per <a>system-level audio callback</a>, and multiple load values will
2464-
be collected over the specified interval period. For example, if
2465-
the renderer runs at a 48Khz sample rate and the <a>system-level
2466-
audio callback</a>'s buffer size is 192 frames, 250 load values
2467-
will be collected over 1 second interval.
2468-
2469-
If the given value is smaller than the duration of
2470-
the <a>system-level audio callback</a>, {{NotSupportedError}} is
2471-
thrown.
2472-
</dl>
2473-
2474-
<h4 interface lt="audiorenderCapacityevent" id="AudioRenderCapacityEvent">
2475-
{{AudioRenderCapacityEvent}}</h4>
2476-
2477-
<pre class="idl">
2478-
[Exposed=Window]
2479-
interface AudioRenderCapacityEvent : Event {
2480-
constructor (DOMString type, optional AudioRenderCapacityEventInit eventInitDict = {});
2481-
readonly attribute double timestamp;
2482-
readonly attribute double averageLoad;
2483-
readonly attribute double peakLoad;
2484-
readonly attribute double underrunRatio;
2485-
};
2486-
2487-
dictionary AudioRenderCapacityEventInit : EventInit {
2488-
double timestamp = 0;
2489-
double averageLoad = 0;
2490-
double peakLoad = 0;
2491-
double underrunRatio = 0;
2492-
};
2493-
</pre>
2494-
2495-
<h5 id="AudioRenderCapacityEvent-attributes">
2496-
Attributes</h5>
2497-
2498-
<dl dfn-type=attribute dfn-for="AudioRenderCapacityEvent">
2499-
: <dfn>timestamp</dfn>
2500-
::
2501-
The start time of the data collection period in terms of the
2502-
associated {{AudioContext}}'s {{BaseAudioContext/currentTime}}.
2503-
: <dfn>averageLoad</dfn>
2504-
::
2505-
An average of collected load values over the given update
2506-
interval. The precision is limited to 1/100th.
2507-
: <dfn>peakLoad</dfn>
2508-
::
2509-
A maximum value from collected load values over the given update
2510-
interval. The precision is also limited to 1/100th.
2511-
: <dfn>underrunRatio</dfn>
2512-
::
2513-
A ratio between the number of buffer underruns (when a
2514-
<a>load value</a> is greater than 1.0) and the total number of
2515-
<a>system-level audio callback</a>s over the given update interval.
2516-
2517-
Where \(u\) is the number of buffer underruns and \(N\) is the
2518-
number of <a>system-level audio callback</a>s over the given update
2519-
interval, the buffer underrun ratio is:
2520-
- 0.0 if \(u\) = 0.
2521-
- Otherwise, compute \(u/N\) and take a ceiling value of the
2522-
nearest 100th.
2523-
</dl>
2524-
25252397
<!--
25262398
███████ ████████ ████████ ██ ████ ██ ██ ████████ ███ ██████
25272399
██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██

0 commit comments

Comments
 (0)