---
title: Microphone Access
description: Capture and monitor microphone input from WendyOS apps
---

## Microphone Access

Microphones use the `audio` entitlement. This grants the app access to ALSA audio devices for recording, voice commands, wake-word detection, speech-to-text, and audio analysis.

Add the entitlement from your project directory:

```bash
wendy project entitlements add audio
```

## Inspect Audio Devices

List audio input and output devices on the target:

```bash
wendy device audio list
```

The output includes device IDs, device names, type, and which device is currently default.

To set a specific audio device as the default:

```bash
wendy device audio set-default --id 1
```

In an interactive terminal, omit `--id` to choose from the audio device list.

## Monitor Microphone Levels

Use the built-in VU meter to confirm the microphone is producing input:

```bash
wendy device audio monitor --id 1
```

You can adjust the update rate:

```bash
wendy device audio monitor --id 1 --rate 20
```

## Stream Microphone Audio

To listen to microphone input locally:

```bash
# Interactive picker (recommended)
wendy device audio listen

# Use a specific device
wendy device audio listen --id 1
```

To write raw PCM to stdout for another tool:

```bash
wendy device audio listen --id 1 --sample-rate 16000 --channels 1 --stdout
```

### Device Selection

When `--id` is omitted, the CLI auto-selects a single microphone, or presents an interactive picker when multiple microphones are available. On platforms with virtual audio endpoints (e.g., Jetson Tegra ADMAIF routing FIFOs), the picker excludes devices matching known virtual/dummy patterns (ADMAIF, HDMI, dummy, loopback, null, virtual) by default. Use `--all` to include these in the selection pool:

```bash
wendy device audio listen --all
```

### Latency Control

The `--buffer-ms` flag controls the playback jitter-buffer target in milliseconds. Lower values reduce latency but increase susceptibility to dropouts on jittery networks:

```bash
# Lower latency (more prone to dropouts)
wendy device audio listen --buffer-ms 15

# Higher latency (smoother playback)
wendy device audio listen --buffer-ms 50
```

## App Configuration

A minimal microphone app uses:

```json
{
  "appId": "com.example.microphone",
  "platform": "linux",
  "version": "1.0.0",
  "entitlements": [
    { "type": "audio" }
  ]
}
```

Then deploy:

```bash
wendy run
```

<CliShot flow="run" step="deploy" alt="The Wendy CLI deploying a microphone app to a WendyOS device" />
