volume

View as MarkdownOpen in Claude

Adjust the playback volume.

Parameters

volume
numberRequired

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

Returns

Promise<Record<string, unknown>> — Server acknowledgment.

Example

import { RelayClient } from '@signalwire/sdk';
const client = new RelayClient({
project: process.env.SIGNALWIRE_PROJECT_ID!,
token: process.env.SIGNALWIRE_API_TOKEN!,
contexts: ['default']
});
client.onCall(async (call) => {
await call.answer();
const action = await call.play(
[{ type: 'audio', url: 'https://example.com/hold-music.mp3' }],
{ loop: 0 },
);
// Increase volume
await action.volume(10.0);
// Decrease volume
await action.volume(-5.0);
});
await client.run();