volume

View as MarkdownOpen in Claude

Adjust the playback volume.

Parameters

volume
floatRequired

Volume adjustment in dB. Range: -40.0 to 40.0.

Returns

dict — Server acknowledgment.

Example

from signalwire.relay import RelayClient
client = RelayClient(
project="your-project-id",
token="your-api-token",
contexts=["default"],
)
@client.on_call
async def handle_call(call):
await call.answer()
action = await call.play(
[{"type": "audio", "params": {"url": "https://example.com/hold-music.mp3"}}],
loop=0,
)
# Increase volume
await action.volume(10.0)
# Decrease volume
await action.volume(-5.0)
client.run()