@@ -1477,7 +1477,6 @@ interface AudioContext : BaseAudioContext {
1477
1477
readonly attribute double baseLatency;
1478
1478
readonly attribute double outputLatency;
1479
1479
[SecureContext] readonly attribute (DOMString or AudioSinkInfo) sinkId;
1480
- [SecureContext] readonly attribute AudioRenderCapacity renderCapacity;
1481
1480
attribute EventHandler onsinkchange;
1482
1481
attribute EventHandler onerror;
1483
1482
AudioTimestamp getOutputTimestamp ();
@@ -1725,11 +1724,6 @@ Attributes</h4>
1725
1724
useful to query this value frequently when accurate
1726
1725
synchronization is required.
1727
1726
1728
- : <dfn>renderCapacity</dfn>
1729
- ::
1730
- Returns an {{AudioRenderCapacity}} instance associated with
1731
- an {{AudioContext}}.
1732
-
1733
1727
: <dfn>sinkId</dfn>
1734
1728
::
1735
1729
Returns the value of {{AudioContext/[[sink ID]]}} internal slot. This
@@ -2396,132 +2390,6 @@ Dictionary {{AudioTimestamp}} Members</h5>
2396
2390
[[!hr-time-3]]).
2397
2391
</dl>
2398
2392
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
-
2525
2393
<!--
2526
2394
███████ ████████ ████████ ██ ████ ██ ██ ████████ ███ ██████
2527
2395
██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██
0 commit comments