# Set Audio Device for Raycast

URL: https://www.raycast.com/benvp/audio-device

> Switch the active audio device of your mac.

- Install: raycast://extensions/benvp/audio-device
- Author: [Benjamin von Polheim](https://www.raycast.com/benvp)
- Installs: 80,236
- Platforms: macOS, Windows
- Categories: AI Extensions
- Updated: 2026-10-05
- Source: https://github.com/raycast/extensions/tree/4cf8ae0ff9f45cd7d803a924b967007516d03ca6/extensions/audio-device/

## Commands

- **Set Output Device**: Sets the active audio output device.
- **Set Input Device**: Sets the active audio input device.
- **Set Output Volume**: Set the volume of an output device.
- **Set Input Volume**: Set the volume of an input device.
- **Enforce Input Device**: Keeps your default input device and pinned volumes in place. Runs silently in the background every minute. If you disable this, your default device and pinned volumes will stop being enforced — macOS may switch devices or reset volumes after sleep, Bluetooth reconnects, etc.
- **Enforce Output Device**: Keeps your default output device and pinned volumes in place. Runs silently in the background every minute. If you disable this, your default device and pinned volumes will stop being enforced — macOS may switch devices or reset volumes after sleep, Bluetooth reconnects, etc.

## AI tools

- **List Audio Devices**: List available input or output devices, their IDs, and which one is currently active. Use before switching to a named device.
- **Set Audio Device**: Switch the active input or output device using an ID from List Audio Devices.
- **Get Audio Volume**: Get the current input or output device volume as a percentage from 0 to 100.
- **Set Audio Volume**: Set the current input or output device volume to a percentage from 0 to 100.

## README

### Set Audio Device

Switch audio devices, lock volumes, and stop macOS from changing your sound settings after sleep or Bluetooth reconnects.

#### What you can do

**Switch devices.** Open "Set Output Device" or "Set Input Device". Press Enter to switch. The window stays open so you can keep working.

**Lock a device in place.** Press Cmd+Shift+D on any device to make it your default. If macOS switches away (after sleep, Bluetooth reconnect, plugging in a monitor), the extension switches back on the next background refresh (roughly every minute). Manually switching gives you a 1-minute grace period before enforcement resumes.

**Lock a volume level.** Press Cmd+Shift+V on any device to pin its volume. If macOS resets it, the extension restores it on the next background refresh (roughly every minute). Changes under 2% are ignored so minor system adjustments don't trigger a reset.

**See volume levels.** Each device shows its current volume percentage. HDMI/DisplayPort devices that don't support software volume control show "Volume controlled by device".

**Mute/unmute.** Press Cmd+M on any device that supports mute.

**Set exact volume.** "Set Output Volume" and "Set Input Volume" commands let you enter a specific volume (0-100) and optionally pin it.

**Switch entire setups at once.** Combo commands let you switch input and output together — e.g., "desk" vs "meeting" vs "headphones". Disabled by default; enable in Raycast preferences.

#### Commands

| Command               | What it does                                                                      |
| --------------------- | --------------------------------------------------------------------------------- |
| Set Output Device     | Browse and switch output devices                                                  |
| Set Input Device      | Browse and switch input devices                                                   |
| Set Output Volume     | Set volume for any output device (0-100)                                          |
| Set Input Volume      | Set volume for any input device (0-100)                                           |
| Enforce Output Device | Runs in background. Keeps your default output device and pinned volumes in place. |
| Enforce Input Device  | Runs in background. Keeps your default input device and pinned volumes in place.  |
| Combo 1 / 2 / 3       | Switch input + output together. Disabled by default.                              |

#### Keyboard shortcuts (in device list)

| Shortcut    | Action                      |
| ----------- | --------------------------- |
| Enter       | Switch to device            |
| Cmd+M       | Mute / Unmute               |
| Cmd+Shift+D | Set or clear default device |
| Cmd+Shift+V | Pin or unpin volume         |

#### How enforcement works

The enforce commands run silently every minute. They check two things:

1. **Default device** — if your default device is connected but not active, switch to it. Skipped for 1 minute after a manual switch so you can temporarily use another device.
2. **Pinned volumes** — if a pinned volume has drifted by 2% or more, reset it.

If neither is configured, the commands do nothing.
