Browser SDK
Call
One call, its state, its controls and its audio levels.
Properties
Prop
Type
Methods
| Method | What it does |
|---|---|
answer(options?): Promise<void> | Answers an incoming call, with the same input, output, inputVolume and outputVolume options as phone.call(). Call it from a user action. Rejects with call_not_active if the caller already hung up |
hangup(): Promise<void> | Ends the call, or declines it while it rings |
mute(muted = true): void | Stops or resumes sending the microphone; the call stays up |
Audio
Every audio setting can change while the call runs, without a gap in the sound:
| Method | What it does |
|---|---|
setInput(device: string | MediaStream): Promise<void> | Switches the microphone. Rejects with microphone_denied or microphone_not_found and keeps the previous one |
setOutput(deviceId: string): Promise<void> | Switches the speaker. Rejects with not_supported in Safari |
setInputVolume(volume: number): void | Microphone gain, 0 (silent) to 2 (+6 dB); 1 leaves it unchanged |
setOutputVolume(volume: number): void | Playback volume, 0 to 2 |
The SDK's own processing still applies at any volume: the soft limiter keeps a loud microphone from saturating the
network codec, so a high inputVolume rounds peaks instead of clipping them.
const call = await phone.call({ to, input: micId, output: speakerId, inputVolume: 0.8 });
volumeSlider.oninput = () => call.setOutputVolume(Number(volumeSlider.value));
micSelect.onchange = () => call.setInput(micSelect.value);Events
Prop
Type