Re: Audio

Hash: SHA1

On Sun, 8 Aug 2004, csant wrote:

> The specs are IMHO not the place to prevent authors from doing
> non-sensible stuff - if you want, you have plenty of means to
> completely destroy display with valid CSS.


> Nevertheless I have some doubt about pseudo class :visible as
> well. The problem is that we still have no means of preventing
> sound-salads of simultaneously playing audio files, as you might
> have two elements with :visible that are visible at the same
> time...

The "sound-salad" idea of overlapping sounds is a bit like the sound
environment in the natural world. Your ears are exposed to lots of
different sounds overlaying each other - some people talking, a
passing car, a sea gull flying overhead, the sound of the wind,
people's footsteps and so on.

Sound effects for web pages can be effective or a jarring cacophany,
authors will learn what works, or users will turn away from their
pages. In this view sounds should be mixed rather than serialized.

For instance, the following would in principle play the same sound
at the same time for all paragraphs and likewise for all h1
elements.  Probably not what the author intended.

   h1 { sound: url(wind.wav) }
   p { sound: url(waves.wav) }

As an author you need to decide what sounds to play when the page
is loaded, while its loaded and when its unloaded. Having done so
these can then be declared with the body element, e.g.

   body { sound: url(waves.wav) repeat }

The 'repeat' modified causes the sound to be repeated indefinitely
while the current state holds. In this case, while the page is

Let's say we wanted to play a different sound while a div is
visible, then we could do:

   div.upbeat:visible {
     sound: url(drum-beat.wav) repeat

This would mix with the sound associated with the body element.
We might be able to suppress sounds from parent or ancestor
elements by adding the 'no-mix' modifier e.g.

   div.upbeat:visible {
     sound: url(drum-beat.wav) repeat no-mix

A further idea is to fade the sound up when the div becomes
visble and to fade it out when it loses visibility, e.g.

   div.upbeat:visible {
     sound: url(drum-beat.wav) repeat no-mix fade

Note that the above property is purely hypothetical, and that
W3C is still collecting ideas for a possible future CSS3 audio

One thing missing from the above is a means to play one sound
when a state first becomes true, another when it subsequently
becomes false, and yet another to play in between, repeating
as necessary. This suggests three properties:

     The sound to play when the state becomes true
     The sound to play when the state becomes false
     The sound to play between the above two

This has problems, as we don't normally know in advance when
a state is going to become false, e.g. when the page will
be unloaded. Perhaps it is simpler to stick with the single
sound property after all.

p.s. I think that :visible is addressing a different issue
and has value in its own right.

- -- 
 Dave Raggett <>  W3C lead for voice and multimodal. +44 1225 866240 (or 867351)
Version: GnuPG v1.2.4 (GNU/Linux)


Received on Sunday, 8 August 2004 12:01:19 UTC