audio

NAME

audio — text-to-speech, audio playback, and notifications in SLICC

DESCRIPTION

SLICC can speak text, play audio files, and trigger notification sounds — all via the Web Audio API and Web Speech API running in the browser. Three commands expose these capabilities: say for speech synthesis, afplay for audio file playback, and chime for notification sounds.

SAY

Synopsis

say [-v voice] [-r rate] [-l lang] [--list] <text>

Description

Speaks the given text aloud using the Web Speech API. A language tag is always required. Voice selection supports partial name matching against the browser's available voices.

Options

Examples

say -l en-US "Hello, world"
say -v samantha -l en-US -r 1.2 "Welcome to SLICC"
say --list

AFPLAY

Synopsis

afplay [-v volume] [-r rate] <file>

Description

Plays an audio file using the Web Audio API. The file is read from the virtual filesystem, decoded, and played through the browser's audio output. Only one file can be specified per invocation; the command returns when playback finishes.

Options

Supported Formats

Any format the browser's Web Audio API can decode: MP3, WAV, OGG, AAC, FLAC, and WebM audio. Exact support varies by browser.

Examples

afplay /shared/sounds/alert.mp3
afplay -v 0.5 /shared/sounds/intro.wav
afplay -r 2 /shared/sounds/chime.mp3

CHIME

Synopsis

chime

Description

Plays the built-in notification chime sound at full volume. This is a convenience alias for:

afplay /shared/sounds/chime.mp3

Takes no arguments. Useful for signaling task completion or drawing attention.

Examples

long-running-task && chime

NOTES

Audio playback in the browser is subject to the user gesture policy. The AudioContext starts in a suspended state and is only unlocked after the user's first interaction with the page (click, keypress, etc.). Once unlocked, all audio commands work freely for the lifetime of the tab.

The browser tab must be active and not discarded for audio to play. Background tabs may have audio throttled or suspended by the browser.

If the Web Speech API or Web Audio API is unavailable in the current environment, the commands will exit with an error message.

SEE ALSO

open, screencapture