Play
PlayAction streams an audio file to the caller. URL must resolve to an allow-listed CDN host (see URLAllowFunc).
PlayAction streams an audio file to the caller. URL must resolve to an allow-listed CDN host (see URLAllowFunc).
| Parameter | Type | JSON key | Required | Description |
|---|---|---|---|---|
URL | string | url | Yes | URL is the audio file URL. Required; must be on the CDN allow-list. |
Loop | int | loop | No | Loop is the number of times to play the file. 0 means once. |
import { sauti } from "@sautikit/node";
res.json(sauti.play("https://cdn.example.com/audio/confirmation.wav"));{
"actions": [
{
"play": {
"url": "https://cdn.example.com/audio/confirmation.wav"
}
}
]
}<Play>https://cdn.example.com/audio/confirmation.wav</Play>