{"version":"2.1.242","anchor":"plugins-can-play-sounds-and-speak-within-per-session-budgets","canonical_anchor":"plugins-can-play-sounds-and-speak-within-per-session-budgets","heading":"Plugins can play sounds and speak, within per-session budgets","tier":"use","area":"Plugins","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.242\/e\/plugins-can-play-sounds-and-speak-within-per-session-budgets","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.242","markdown":"### Plugins can play sounds and speak, within per-session budgets\n\nPlugins can play sounds and speak aloud, capped per session, on macOS and browser hosts only.\n\n**What**\n\nPlugins get two new calls, `$.audio.play` and `$.audio.speak`. Playback works only where there is a player: a browser host, or macOS via `afplay` for clips and `say` for speech. On Linux and Windows terminals playing a clip does nothing and speaking is rejected. Each plugin has a cap on total plays per session and on concurrent plays.\n\n**Details**\n\n- A clip is exactly one of `asset` (a path inside the plugin's own directory), `url` (fetched through the same URL safety check used elsewhere), or `base64` plus `mime`. There is a byte cap on the clip.\n- `loop` is optional and requires a signal to stop it. `gain` is clamped to a maximum.\n- Speech prefers the browser `speechSynthesis` API when present, then macOS `say`.\n\n**Evidence**\n\n`$.audio.play: clip must be { asset }, { url } or { base64, mime }`\n\n- Area: Plugins\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 4\/5"}