> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# setAudioDevice()

> Switch to a specific audio input device on a mobile device by device ID.

`setAudioDevice(deviceId)`

Switches the local audio stream to the device identified by `deviceId`. The `deviceId` should match a `deviceId` value returned by [`enumerateDevices()`](/reference/react-native/instance-methods/enumerate-devices).

If the requested device becomes unavailable (for example, a Bluetooth device that disconnects), the resolved `deviceId` may differ from the one requested.

## Parameters

<ParamField body="deviceId" type="string" required>
  The `deviceId` of the audio device to switch to.
</ParamField>

## Return value

Returns a `Promise<{ deviceId: string }>` with the `deviceId` of the audio device that was actually applied.

## Example

```javascript theme={null}
const { devices } = await call.enumerateDevices();
const speakerphone = devices.find(
  (d) => d.kind === 'audioinput' && d.label.includes('Speakerphone')
);
if (speakerphone) {
  const { deviceId } = await call.setAudioDevice(speakerphone.deviceId);
  console.log('Now using audio device:', deviceId);
}
```

## See also

<CardGroup>
  <Card title="Methods" icon="code" iconType="solid">
    * [enumerateDevices()](/reference/react-native/instance-methods/enumerate-devices)
    * [getInputDevices()](/reference/react-native/instance-methods/get-input-devices)
    * [nativeInCallAudioMode()](/reference/react-native/instance-methods/native-in-call-audio-mode)
    * [setNativeInCallAudioMode()](/reference/react-native/instance-methods/set-native-in-call-audio-mode)
  </Card>
</CardGroup>
