Skip to content
4 changes: 2 additions & 2 deletions .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- name: Checking out the repository
uses: actions/checkout@v4
- name: Setting up Python 3.9
- name: Setting up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.12'
- name: Installing and updating Bikeshed
run: pip3 install bikeshed && bikeshed update
shell: bash
Expand Down
93 changes: 53 additions & 40 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4202,7 +4202,7 @@ Methods</h4>
</div>

<pre class=argumentdef for="AudioParam/cancelAndHoldAtTime()">
cancelTime: The time after which any previously scheduled parameter changes will be cancelled. It is a time in the same time coordinate system as the {{AudioContext}}'s {{BaseAudioContext/currentTime}} attribute. <span class="synchronous">A {{RangeError}} exception MUST be thrown if <code>cancelTime</code> is negative. If {{AudioParam/cancelAndHoldAtTime()/cancelTime}} is less than {{BaseAudioContext/currentTime}}, it is clamped to {{BaseAudioContext/currentTime}}.
cancelTime: The time after which any previously scheduled parameter changes will be cancelled. It is a time in the same time coordinate system as the {{AudioContext}}'s {{BaseAudioContext/currentTime}} attribute. <span class="synchronous">A {{RangeError}} exception MUST be thrown if <code>cancelTime</code> is negative.</span> If {{AudioParam/cancelAndHoldAtTime()/cancelTime}} is less than {{BaseAudioContext/currentTime}}, it is clamped to {{BaseAudioContext/currentTime}}.
</pre>

<div>
Expand Down Expand Up @@ -8861,7 +8861,7 @@ enum OscillatorType {
<table class="simple" dfn-type=enum-value dfn-for="OscillatorType">
<caption>{{OscillatorType}} enumeration description</caption>
<thead>
<th>Enum value</th><th>Description</th>
<tr><th>Enum value</th><th>Description</th></tr>
<tbody>
<tr><td>"<dfn>sine</dfn>" <td>A sine wave
<tr><td>"<dfn>square</dfn>" <td>A square wave of duty period 0.5
Expand Down Expand Up @@ -9134,7 +9134,7 @@ enum PanningModelType {
<table class="simple" dfn-type=enum-value dfn-for="PanningModelType">
<caption>{{PanningModelType}} enumeration description</caption>
<thead>
<th>Enum value</th><th>Description</th>
<tr><th>Enum value</th><th>Description</th></tr>
<tbody>
<tr><td>"<dfn>equalpower</dfn>"
<td>
Expand Down Expand Up @@ -9186,7 +9186,10 @@ enum DistanceModelType {
<table class="simple" dfn-type=enum-value dfn-for="DistanceModelType">
<caption>{{DistanceModelType}} enumeration description</caption>
<thead>
<th>Enum value</th><th>Description</th>
<tr>
<th>Enum value</th>
<th>Description</th>
</tr>
<tbody>
<tr>
<td>"<dfn>linear</dfn>"
Expand Down Expand Up @@ -10077,7 +10080,10 @@ enum OverSampleType {
<table class="simple" dfn-type=enum-value dfn-for="OverSampleType">
<caption>{{OverSampleType}} enumeration description</caption>
<thead>
<th>Enum value</th><th>Description</th>
<tr>
<th>Enum value</th>
<th>Description</th>
</tr>
<tbody>
<tr><td>"<dfn>none</dfn>"
<td>Don't oversample
Expand Down Expand Up @@ -11666,8 +11672,8 @@ Each {{AudioContext}} possesses exactly one {{AudioPlaybackStats}}.
Attributes</h4>

Note: These attributes update only once per second and under specific
conditions. See [[#update-audio-stats]] and [[#AudioPlaybackStats-mitigations]]
for details.
conditions. See [[#update-audio-stats]] and
[[#AudioPlaybackStats-privacy-mitigations]] for details.

<dl dfn-type=attribute dfn-for="AudioPlaybackStats">
: <dfn>underrunDuration</dfn>
Expand All @@ -11677,32 +11683,37 @@ for details.
NOTE: This metric can be used together with {{totalDuration}} to
calculate the percentage of played out media that was not provided by
the {{AudioContext}}.

</dl>

<dl dfn-type=attribute dfn-for="AudioPlaybackStats">
: <dfn>underrunEvents</dfn>
::
Returns the value of the {{[[underrun events]]}} internal slot.
</dl>

<dl dfn-type=attribute dfn-for="AudioPlaybackStats">
: <dfn>totalDuration</dfn>
::
Returns the value of the {{[[total duration]]}} internal slot.
</dl>

<dl dfn-type=attribute dfn-for="AudioPlaybackStats">
: <dfn>averageLatency</dfn>
::
Returns the value of the {{[[average latency]]}} internal slot.
</dl>

<dl dfn-type=attribute dfn-for="AudioPlaybackStats">
: <dfn>minimumLatency</dfn>
::
Returns the value of the {{[[minimum latency]]}} internal slot.
</dl>

<dl dfn-type=attribute dfn-for="AudioPlaybackStats">
: <dfn>maximumLatency</dfn>
::
Returns the value of the {{[[maximum latency]]}} internal slot.
</dl>

<h4 id="AudioPlaybackStats-methods">
Methods</h4>
Expand All @@ -11721,40 +11732,42 @@ Methods</h4>
1. Set {{[[average latency]]}} to <var>currentLatency</var>.
1. Set {{[[minimum latency]]}} to <var>currentLatency</var>.
1. Set {{[[maximum latency]]}} to <var>currentLatency</var>.
</dl>

<h4 id="update-audio-stats"> Updating the stats</h4>
<div algorithm="update audio stats">
Once per second, execute the update audio stats algorithm:
1. If {{[[audio context]]}} is not running, abort these steps.
1. Let <var>canUpdate</var> be false.
1. Let <var>document</var> be the current [=this=]'s
[=relevant global object=]'s [=associated Document=].
If <var>document</var> is [=Document/fully active=] and <var>document</var>'s
[=Document/visibility state=] is `"visible"`, set <var>canUpdate</var> to
true.
1. Let <var>permission</var> be the [=permission state=] for the permission
associated with [="microphone"=] access.
If <var>permission</var> is "granted", set <var>canUpdate</var> to true.
1. If <var>canUpdate</var> is false, abort these steps.
1. Set {{[[underrun duration]]}} to the total duration of all [=underrun events=]
(in seconds)
that have occurred in {{[[audio context]]}} playback since its construction.
1. Set {{[[underrun events]]}} to the total number of [=underrun events=]
that have occurred in {{[[audio context]]}} playback since its
construction.
1. Set {{[[total duration]]}} to {{[[underrun duration]]}} +
{{[[audio context]]}}.{{BaseAudioContext/currentTime}}.
1. Set {{[[average latency]]}} to the average playback latency (in seconds) of
{{[[audio context]]}} playback over the {{currently tracked interval}}.
1. Set {{[[minimum latency]]}} to the minimum playback latency (in seconds) of
{{[[audio context]]}} playback over the {{currently tracked interval}}.
1. Set {{[[maximum latency]]}} to the maximum playback latency (in seconds) of
{{[[audio context]]}} playback over the {{currently tracked interval}}.
1. If {{[[audio context]]}} is not running, abort these steps.
1. Let <var>canUpdate</var> be false.
1. Let <var>document</var> be the current [=this=]'s
[=relevant global object=]'s [=associated Document=].
If <var>document</var> is [=Document/fully active=] and <var>document</var>'s
[=Document/visibility state=] is `"visible"`, set <var>canUpdate</var> to
true.
1. Let <var>permission</var> be the [=permission state=] for the permission
associated with "microphone" access.
If <var>permission</var> is "granted", set <var>canUpdate</var> to true.
1. If <var>canUpdate</var> is false, abort these steps.
1. Set {{[[underrun duration]]}} to the total duration of all [=underrun events=]
(in seconds)
that have occurred in {{[[audio context]]}} playback since its construction.
1. Set {{[[underrun events]]}} to the total number of [=underrun events=]
that have occurred in {{[[audio context]]}} playback since its
construction.
1. Set {{[[total duration]]}} to {{[[underrun duration]]}} +
{{[[audio context]]}}.{{BaseAudioContext/currentTime}}.
1. Set {{[[average latency]]}} to the average playback latency (in seconds) of
{{[[audio context]]}} playback over the {{currently tracked interval}}.
1. Set {{[[minimum latency]]}} to the minimum playback latency (in seconds) of
{{[[audio context]]}} playback over the {{currently tracked interval}}.
1. Set {{[[maximum latency]]}} to the maximum playback latency (in seconds) of
{{[[audio context]]}} playback over the {{currently tracked interval}}.
</div>

<h4>Privacy considerations for {{AudioPlaybackStats}}</h4>
<h4 id="AudioPlaybackStats-privacy-considerations">
Privacy considerations for {{AudioPlaybackStats}}</h4>

<h5>Risk</h5>
<h5 id="AudioPlaybackStats-privacy-risks">Risk</h5>
Audio underrun information could be used to form a cross-site
covert channel between two cooperating sites.
One site could transmit information by intentionally causing audio glitches
Expand All @@ -11765,7 +11778,8 @@ Note: This covert channel depends on specific system characteristics.
It typically requires a shared linearization point (such as an OS or browser
audio mixer) and callbacks that are effectively synchronous from that point,
without intermediate buffering that would flatten load spikes.
<h5 id="AudioPlaybackStats-mitigations">Mitigations</h5>

<h5 id="AudioPlaybackStats-privacy-mitigations">Mitigations</h5>
To inhibit the usage of such a covert channel, the API implements these
mitigations.
- The values returned by the API MUST not be updated more than once per
Expand Down Expand Up @@ -11855,10 +11869,9 @@ thread</a> is done using <a>control message</a> passing.
Communication in the other direction is done using regular event loop
tasks.

Each {{AudioContext}} has a single <dfn>control message
queue</dfn> that is a list of <dfn lt="control message">control
messages</dfn> that are operations running on the <a>rendering
thread</a>.
Each {{AudioContext}} has a single <dfn>control message queue</dfn>
that is a list of <dfn lt="control message">control messages</dfn> that are
operations running on the <a>rendering thread</a>.

<dfn id="queuing" lt="queue a control message">Queuing a control message</dfn>
means adding the message to the end of the <a>control message queue</a> of an
Expand Down
Loading