> This page is for Browser SDK, version v3.
> For other versions, use one of these documentation indexes:
> - v4 (default): https://signalwire.com/docs/browser-sdk/v4/llms.txt
> - v3: https://signalwire.com/docs/browser-sdk/v3/llms.txt
> - v2: https://signalwire.com/docs/browser-sdk/v2/llms.txt

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# updateSpeaker

> updateSpeaker method for the RoomSession class.

### updateSpeaker

* **updateSpeaker**(`opts`): `Promise<undefined>`

Replaces the current speaker with a different one.

> 📘
> Some browsers do not support output device selection. You can check by calling [WebRTC.supportsMediaOutput](/docs/browser-sdk/v3/js/reference/webrtc#supportsmediaoutput).

#### Parameters

**`opts`** `object`

Object containing the parameters of the method.

---

**`deviceId`** `string`

Id of the new speaker device.

---

#### Returns

`Promise<undefined>`

#### Example

Replaces the current speaker:

```javascript
await roomSession.updateSpeaker({
  deviceId: "/o4ZeWzroh+8q0Ds/CFfmn9XpqaHzmW3L/5ZBC22CRg=",
});
```