For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
        • addSection
        • addVerb
        • addVerbToSection
        • ai
        • answer
        • build
        • document
        • getDocument
        • getSchemaUtils
        • hangup
        • play
        • render
        • renderDocument
        • reset
        • say
        • setValidation
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Example
AgentsSwmlBuilder

say

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

setValidation

Next
Built with

Convenience wrapper that appends a play verb with a say:-prefixed URL for text-to-speech. Equivalent to calling builder.play({ url: 'say:${text}', ... }) but exposes the TTS options as typed arguments.

Parameters

text
stringRequired

Text the agent should speak. The method prepends say: to produce the final URL passed to the underlying play verb.

opts
object

Optional TTS parameters.

opts.voice
string

Voice name for the TTS engine. Maps to say_voice in the emitted SWML.

opts.language
string

Language code (e.g., "en-US"). Maps to say_language in the emitted SWML.

opts.gender
string

Gender for TTS voice selection. Maps to say_gender in the emitted SWML.

opts.volume
number

Volume adjustment in dB (−40 to 40). Maps to volume on the play verb.

Returns

this — The builder instance for method chaining.

Example

1import { SwmlBuilder } from '@signalwire/sdk';
2
3const builder = new SwmlBuilder();
4builder.answer();
5builder.say('Welcome to our service.', { voice: 'rime.spore', language: 'en-US' });
6builder.hangup();