XML technologies / CSS / Advanced websites with CSS / Miscellaneous CSS topics / Aural stylesheets

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

Sound is still used relatively rarely for communication on the web. Flash movies, video streams and podcasts show that audio content is increasingly gaining a key role. Opinions differ, however, on using sound files to improve navigation or interfaces, particularly for visually impaired users. In the future, speech, soundscapes and combinations of voice and music could make many websites more exciting and lively for everyone. The W3C has specified a range of acoustic properties that can be defined with CSS, producing an aural stylesheet.

Here is part of an aural stylesheet borrowed from the W3C website:

h1, h2, h3, h4, h5, h6 {
  voice-family: paul;
  stress: 20;
  richness: 90;
  cue-before: url(ping.au);
}
p.heidi {
  azimuth: center-left;
}
p.peter {
  azimuth: right;
}
p.ziege {
  volume: x-soft;
}

Let us examine this CSS fragment line by line.

All headings are spoken using a voice-family named paul. A voice-family is similar to a font-family: it consists of variations of a voice. We give spoken headings a relatively low value for the property stress of 20. This defines the voice’s “contour,” the gradual modulation differences in different parts of a sentence.

In the example, we set richness to the relatively high value 90. This property controls volume. Before a heading is spoken, we play a sound named ping.au. With cue-before or cue-after, we specify whether the signal comes before or after the audio section.

Every paragraph assigned to the class heidi is heard as coming slightly from the left of the vertical center. Paragraphs assigned to class peter are heard from the user’s right. All paragraphs with ziege are spoken particularly softly.

Aural stylesheets control the following characteristics of a spoken voice on your website:

For a list of all properties controlling these factors, see CSS property reference.

  

 

 

 

back to top