Accessibility
A sound is for everyone, and so is its wave. Accessibility is SonicFrame's first priority: the basics are always on, and the extras are one option away.
Always on
Every frame and player, with nothing to set:
-
The wave is a slider. It has
role="slider", is reachable with Tab, and says its position in words ("0:12 of 0:45") througharia-valuetext. On a page of many players,a11y.sliderName: 'both'names each slider by its sound too ("Little Elf, Playback position"). - The keys of the WAI-ARIA slider pattern. Arrows, Page Up and Page Down, Home and End. See Keyboard.
-
Real buttons. Play, skip, speed,
volume and zoom are
<button>elements with names that change with their state ("Play", "Pause"). -
Focus is never lost. A zoom button
at its limit is marked
aria-disabledinstead ofdisabled, so the focus stays on it. - Less motion is respected. No grow-in and no animated buttons for people who asked their system for less motion. See Motion.
- Text you give stays text. Labels, captions and tooltips never become markup, and control or direction-changing characters are removed.
One option away
Everything that adds behavior lives in one group,
a11y, arranged by place, and is off until
you turn it on:
| Option | What it gives | Read more |
|---|---|---|
a11y.lang |
Words in English, Portuguese (Brazil or
Portugal), Spanish or French (or
'auto', the page's
language), and the player marked with
lang so a screen reader
speaks in that voice.
|
Languages |
a11y.label |
The player's accessible name;
'Audio player' in its
language by default.
|
Player options |
a11y.words |
Your own accessible names for every control. | Your own words |
a11y.description |
The sound's shape in words, read by the person's own screen reader. | The wave in words |
a11y.zoom.announce |
"Zoom 4×, 1:20 to 2:40" after a zoom by keys, buttons or fingers. | Screen readers |
a11y.minimap.keys |
The minimap as a slider of the part in view. | The minimap |
Everything a screen reader hears lives in
a11y, and your own words are always
a11y.words: on the player, the play button,
the volume control, the markers and the chapters alike.
On the tag, the same options are attributes that start
with a11y-, from a11y-label to
a11y-chapters:
Your part
-
Name each player.
a11y: { label: 'Voice note from Ana, 0:42' }tells a list of players apart. -
Show the focus. Style
:focus-visibleon the wave's container; see the focus ring. - Mind the contrast. The built-in palettes pass WCAG contrast; check your own colors the same way.
- Give words to what has words. A transcript or caption is still the best description of speech; the caption plugin shows one beside the wave.
How we check it
Every accessible behavior has a test: the roles, the values in words, the keys of each pattern, the names in each language and the live region. What a test cannot prove is how it feels with a real screen reader.