say

View as MarkdownOpen in Claude

Add a text-to-speech play verb using the say: URL prefix. This is a convenience wrapper around play() that constructs the say: URL automatically.

Parameters

text
strRequired

The text to speak.

voice
Optional[str]

Voice name for text-to-speech.

language
Optional[str]

Language code (e.g., "en-US").

gender
Optional[str]

Gender for voice selection.

volume
Optional[float]

Volume adjustment level, from -40 to 40 dB.

Returns

Self — The builder instance for method chaining.

Example

1from signalwire import SWMLService, SWMLBuilder
2
3service = SWMLService(name="greeting")
4builder = SWMLBuilder(service)
5
6doc = (
7 builder
8 .answer()
9 .say("Welcome to our service. Please hold.", voice="rime.spore")
10 .sleep(duration=500)
11 .say("Connecting you now.", voice="rime.spore")
12 .build()
13)
14print(doc)