Skip to content

Commit

Permalink
[ao] (3) Removed the entire Audio section in favour of the new HTMLAu…
Browse files Browse the repository at this point in the history
…dioElement. 'new Audio()' still works, though.

git-svn-id: http://svn.whatwg.org/webapps@730 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 12, 2007
1 parent ca080d6 commit 8211497
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 263 deletions.
160 changes: 21 additions & 139 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -1360,13 +1360,8 @@
</ul>
</ul>

<li><a href="#apis"><span class=secno>7. </span>Miscellaneous APIs</a>
<ul class=toc>
<li><a href="#repetition-templates"><span class=secno>7.1.
</span>Repetition templates</a>

<li><a href="#sound"><span class=secno>7.2. </span>Sound</a>
</ul>
<li><a href="#repetition"><span class=secno>7. </span>Repetition
templates</a>

<li><a href="#syntax"><span class=secno>8. </span>The HTML syntax</a>
<ul class=toc>
Expand Down Expand Up @@ -1604,8 +1599,8 @@
as communicating with other applications from different domains running
on the same client.

<dd><a href="#apis">Miscellaneous APIs</a>: APIs that could not be placed
into other parts of the specification live here.
<dd><a href="#repetition">Repetition Templates</a>: A mechanism to support
repeating sections in forms.

<dt><a href="#syntax">The Language Syntax</a>

Expand Down Expand Up @@ -13098,16 +13093,16 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>
};</pre>
</dl>

<p>An <code><a href="#audio3">audio</a></code> element represents a sound
<p>An <code><a href="#audio1">audio</a></code> element represents a sound
or audio stream.

<p>Content may be provided inside the <code><a
href="#audio3">audio</a></code> element so that older Web browsers, which
do not support <code><a href="#audio3">audio</a></code>, can display text
href="#audio1">audio</a></code> element so that older Web browsers, which
do not support <code><a href="#audio1">audio</a></code>, can display text
to the user informing them of how to access the audio contents. User
agents should not show this fallback content to the user.

<p>The <code><a href="#audio3">audio</a></code> element is a <a
<p>The <code><a href="#audio1">audio</a></code> element is a <a
href="#media5">media element</a> whose <a href="#media7">media data</a> is
ostensibly audio data.

Expand All @@ -13122,18 +13117,18 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>
attributes are <a href="#media6" title="media element attributes">the
attributes common to all media elements</a>.

<p>When an <code><a href="#audio3">audio</a></code> element is <a
<p>When an <code><a href="#audio1">audio</a></code> element is <a
href="#actively">actively playing</a>, it must have its audio data played
synchronised with the <a href="#current">current playback position</a>, at
the specified <a href="#volume" title=dom-media-volume>volume</a> with the
specified <a href="#muted" title=dom-media-muted>mute state</a>.

<p>When an <code><a href="#audio3">audio</a></code> element is not <a
<p>When an <code><a href="#audio1">audio</a></code> element is not <a
href="#actively">actively playing</a>, audio must not play for the
element.

<h5 id=audio0><span class=secno>3.14.8.1. </span>Audio codecs for <code><a
href="#audio3">audio</a></code> elements</h5>
href="#audio1">audio</a></code> elements</h5>

<p>User agents may support any audio codecs and container formats.

Expand Down Expand Up @@ -13641,7 +13636,7 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>
<dd>
<p>The server returning a file of the wrong kind (e.g. one that that
turns out to not be pure audio when the <a href="#media5">media
element</a> is a <code><a href="#audio3">audio</a></code> element), or
element</a> is a <code><a href="#audio1">audio</a></code> element), or
the file using unsupported codecs for all the data, must cause the
user agent to follow the following steps. User agents may also follow
these steps in response to other codec-related fatal errors, such as
Expand Down Expand Up @@ -25351,8 +25346,15 @@ at the first element with the given ID must be treated as if it was cloned and r
<dl>
<dt><dfn id=audio2 title=dom-audio><code>Audio()</code></dfn>

<dt><dfn id=audio3 title=dom-audio><code>Audio(<var
title="">src</var>)</code></dfn>

<dd>
<p>Constructs an <code><a href="#audio3">Audio</a></code> object.
<p>Constructs an <code><a
href="#htmlaudioelement">HTMLAudioElement</a></code> object. If the <var
title=src>src</var> argument is present, the object created must have
its <code title=dom-media-src><a href="#src6">src</a></code> content
attribute set to the provided value.

<dt><dfn id=image0 title=dom-image><code>Image()</code></dfn>

Expand Down Expand Up @@ -31098,132 +31100,12 @@ function receiver(e) {
security reasons. It also requires that UAs be careful to allow access to
certain properties but not others.

<h2 id=apis><span class=secno>7. </span>Miscellaneous APIs</h2>

<h3 id=repetition-templates><span class=secno>7.1. </span>Repetition
templates</h3>
<h2 id=repetition><span class=secno>7. </span>Repetition templates</h2>

<p class=big-issue>See <a
href="http://www.whatwg.org/specs/web-forms/current-work/#repeatingFormControls">WF2</a>
for now

<h3 id=sound><span class=secno>7.2. </span>Sound</h3>

<p class=big-issue>This section is about to be collapsed into the new
<code><a href="#audio3">audio</a></code> element section.

<p>The <code><a href="#audio3">Audio</a></code> interface allows scripts to
play sound clips. This interface is intended for sound effects, not for
streaming audio or multimedia; for the latter, the <code><a
href="#object">object</a></code> element is more appropriate. <span
class=issue>We need to add an API for object to support pausing, etc, of
streaming APIs.</span>

<p>There is no markup element that corresponds to <code><a
href="#audio3">Audio</a></code> objects, they are only accessible from
script.

<p>User agents should allow users to dynamically enable and disable sound
output, but doing so must not affect how <code><a
href="#audio3">Audio</a></code> objects act in any way other than whether
sounds are physically played back or not. For instance, sound files must
still be downloaded, <code>load</code> and <code>error</code> events must
still fire, and if two identical clips are started with a two second
interval then when the sound is reenabled they must still be two seconds
out of sync.

<p>When multiple sounds are played simultaneously, the user agent must mix
the sounds together.

<pre class=idl>interface <dfn id=audio3>Audio</dfn> {<!-- XXX xrefs -->
attribute EventListener onload;
attribute EventListener onerror;
void play();
void loop();
void loop(in unsigned long playCount);
void stop();
};</pre>

<p><code><a href="#audio3">Audio</a></code> objects must also implement the
<code>EventTarget</code> interface. <a
href="#refsDOM3EVENTS">[DOM3EVENTS]</a>

<p>In ECMAScript, an instance of <code><a href="#audio3">Audio</a></code>
can be created using the <code>Audio(<var title="">uri</var>)</code>
constructor:

<pre class=example>var a = new Audio("test.wav");</pre>

<p>The <dfn id=audio4><code>Audio()</code> constructor</dfn> takes a single
argument, a URI (or IRI), which is resolved using the script context's
<code>window.location.href</code> value as the base, and which returns an
<code><a href="#audio3">Audio</a></code> object that will, at the
completion of the current script, start loading that URI.

<p>Once the URI is loaded, a <code>load</code> event must be fired on the
<code><a href="#audio3">Audio</a></code> object.

<p><code><a href="#audio3">Audio</a></code> objects have a current position
and a play count. Both are initially zero.

<p>The <code><a href="#audio3">Audio</a></code> interface has the following
members:</p>
<!-- XXX conf criteria -->

<dl>
<dt><dfn id=onload0 title=Audio.onload>onload</dfn>

<dd>An event listener that is invoked along with any other appropriate
event listeners that are registered on this object when a
<code>load</code> event is fired on it.

<dt><dfn id=play1 title=Audio.play>play()</dfn>

<dd>Begins playing the sound at the current position, setting the play
count to 1.

<dt><dfn id=loop title=Audio.loop>loop()</dfn>

<dd>Begins playing the sound at the current position, setting the play
count to infinity.

<dt><dfn id=loopplaycount title=Audio.loopN>loop(<var
title="">playCount</var>)</dfn>

<dd>Begins playing the sound at the current position, setting the play
count to <var title="">playCount</var>.

<dt><dfn id=stop title=Audio.stop>stop()</dfn>

<dd>Stops playing the clip and resets the current position and play count
to zero.
</dl>

<p>When playback of the sound reaches the end of the available data, its
current position is reset to the start of the clip, and the play count is
decreased by one (unless it is infinite). If the play count is greater
than zero, then the sound is played again.</p>
<!--
var sound = new Audio("URI relative to document URI");
sound.onload = function() { } // onload event handler
sound.play(); // play once
sound.loop(); // loop forever
sound.loop(2); // play twice
sound.stop(); // stop (if playing) and rewind
-->
<!--
WANT
sound.volume = 1.0; // 0.0 to 1.0
sound.pause(); // stop at current position but don't rewind
onerror

MAYBE WANT
sound.seek(l/2); // seek to position, in seconds
sound.pan = 0.0; // -1.0 (left) to 1.0 (right)
l = sound.length; // length of clip in seconds
onprogress
-->

<h2 id=syntax><span class=secno>8. </span>The HTML syntax</h2>

<h3 id=writing><span class=secno>8.1. </span>Writing HTML documents</h3>
Expand Down
132 changes: 8 additions & 124 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@
servers, as well as communicating with other applications from
different domains running on the same client.</dd>

<dd><a href="#apis">Miscellaneous APIs</a>: APIs that could not be
placed into other parts of the specification live here.</dd>
<dd><a href="#repetition">Repetition Templates</a>: A mechanism to
support repeating sections in forms.</dd>


<dt><a href="#syntax">The Language Syntax</a></dt>
Expand Down Expand Up @@ -22833,8 +22833,12 @@ at the first element with the given ID must be treated as if it was cloned and r
<dl>

<dt><dfn title="dom-audio"><code>Audio()</code></dfn></dt>
<dt><dfn title="dom-audio"><code>Audio(<var title="">src</var>)</code></dfn></dt>

<dd><p>Constructs an <code>Audio</code> object.</p></dd>
<dd><p>Constructs an <code>HTMLAudioElement</code> object. If the
<var title="src">src</var> argument is present, the object created
must have its <code title="dom-media-src">src</code> content
attribute set to the provided value.</p></dd>


<dt><dfn title="dom-image"><code>Image()</code></dfn></dt>
Expand Down Expand Up @@ -28611,131 +28615,11 @@ function receiver(e) {



<h2 id="apis">Miscellaneous APIs</h2>


<h3 id="repetition-templates">Repetition templates</h3>
<h2 id="repetition">Repetition templates</h2>

<p class="big-issue">See <a href="http://www.whatwg.org/specs/web-forms/current-work/#repeatingFormControls">WF2</a> for now</p>


<h3 id="sound">Sound</h3>

<p class="big-issue">This section is about to be collapsed into the
new <code>audio</code> element section.</p>

<p>The <code>Audio</code> interface allows scripts to play sound
clips. This interface is intended for sound effects, not for
streaming audio or multimedia; for the latter, the
<code>object</code> element is more appropriate. <span
class="issue">We need to add an API for object to support pausing,
etc, of streaming APIs.</span></p>

<p>There is no markup element that corresponds to <code>Audio</code>
objects, they are only accessible from script.</p>

<p>User agents should allow users to dynamically enable and disable
sound output, but doing so must not affect how <code>Audio</code>
objects act in any way other than whether sounds are physically
played back or not. For instance, sound files must still be
downloaded, <code>load</code> and <code>error</code> events must
still fire, and if two identical clips are started with a two second
interval then when the sound is reenabled they must still be two
seconds out of sync.</p>

<p>When multiple sounds are played simultaneously, the user agent
must mix the sounds together.</p>

<pre class="idl">interface <dfn>Audio</dfn> {<!-- XXX xrefs -->
attribute EventListener onload;
attribute EventListener onerror;
void play();
void loop();
void loop(in unsigned long playCount);
void stop();
};</pre>

<p><code>Audio</code> objects must also implement the
<code>EventTarget</code> interface. <a
href="#refsDOM3EVENTS">[DOM3EVENTS]</a>

<p>In ECMAScript, an instance of <code>Audio</code> can be created
using the <code>Audio(<var title="">uri</var>)</code> constructor:</p>

<pre class="example">var a = new Audio("test.wav");</pre>

<p>The <dfn><code>Audio()</code> constructor</dfn> takes a single
argument, a URI (or IRI), which is resolved using the script
context's <code>window.location.href</code> value as the base, and
which returns an <code>Audio</code> object that will, at the
completion of the current script, start loading that URI.</p>

<p>Once the URI is loaded, a <code>load</code> event must be fired
on the <code>Audio</code> object.</p>

<p><code>Audio</code> objects have a current position and a play
count. Both are initially zero.</p>

<p>The <code>Audio</code> interface has the following members:</p>

<!-- XXX conf criteria -->
<dl>

<dt><dfn title="Audio.onload">onload</dfn></dt>

<dd>An event listener that is invoked along with any other
appropriate event listeners that are registered on this object when
a <code>load</code> event is fired on it.</dd>

<dt><dfn title="Audio.play">play()</dfn></dt>

<dd>Begins playing the sound at the current position, setting the
play count to 1.</dd>

<dt><dfn title="Audio.loop">loop()</dfn></dt>

<dd>Begins playing the sound at the current position, setting the
play count to infinity.</dd>

<dt><dfn title="Audio.loopN">loop(<var title="">playCount</var>)</dfn></dt>

<dd>Begins playing the sound at the current position, setting the
play count to <var title="">playCount</var>.</dd>

<dt><dfn title="Audio.stop">stop()</dfn></dt>

<dd>Stops playing the clip and resets the current position and
play count to zero.</dd>

</dl>

<p>When playback of the sound reaches the end of the available data,
its current position is reset to the start of the clip, and the play
count is decreased by one (unless it is infinite). If the play count
is greater than zero, then the sound is played again.</p>

<!--
var sound = new Audio("URI relative to document URI");
sound.onload = function() { } // onload event handler
sound.play(); // play once
sound.loop(); // loop forever
sound.loop(2); // play twice
sound.stop(); // stop (if playing) and rewind
-->

<!--
WANT
sound.volume = 1.0; // 0.0 to 1.0
sound.pause(); // stop at current position but don't rewind
onerror

MAYBE WANT
sound.seek(l/2); // seek to position, in seconds
sound.pan = 0.0; // -1.0 (left) to 1.0 (right)
l = sound.length; // length of clip in seconds
onprogress
-->



<h2 id="syntax">The HTML syntax</h2>
Expand Down

0 comments on commit 8211497

Please sign in to comment.