Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions docs/SPEECH-REMOTE-AUDIO.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,67 @@ bolted on as a special case.

---

### Choosing the local input device: `#A/audiodev`

The emulator opened whatever the host called the default input device. That
default is not always a microphone: a virtual device installed by another
application can hold it, and such a device produces no samples unless that
application is running. Capture then opens, every sample is zero, and no layer
reports a fault. A silent device and a silent room look identical, and finding
out which it was meant leaving InferNode for a host tool.

`#A/audiodev` makes both the choice and the verdict visible. Read it to
enumerate the devices the host offers and see which is selected:

```
; bind -a '#A' /dev
; cat /dev/audiodev
in selected default
in device 'Built-in Microphone'
in device 'USB Audio Device'
out selected default
out device 'Built-in Output'
capture idle
```

Write `in <name>` or `out <name>` to select one. Names are quoted in the
readback because they contain spaces, and the readback's own forms —
`in device '<name>'` and `in selected '<name>'` — are accepted on write
as well, so a line from the read can be written straight back. `in
default` returns to following the host default. An unknown name is
refused rather than ignored. Selection takes effect at once: a stream
that is already open is reopened on the new device.

```sh
echo 'in Built-in Microphone' > /dev/audiodev
# a line from the read, written back verbatim:
line=`{grep '^in device' /dev/audiodev | sed 1q}
echo $line > /dev/audiodev
```

A launcher that already knows the right device can set it before the
emulator starts, which matters when the voice stack opens capture
during startup — before anything could write `#A/audiodev`. The
environment variables `INFERNODE_AUDIO_IN` and `INFERNODE_AUDIO_OUT`
take a device name each and preselect the input and output device;
an unknown name is not validated at startup but warned about and
fallen back to the system default at open time.

The last line is the diagnostic. `capture active` means the device produced at
least one non-zero sample. `capture silent` means it delivered data and all of
it was zero. `capture idle` means it delivered nothing. It describes the most
recent capture rather than only a live one, so it can be read after a recording
finishes. A capture that stays silent for two seconds also prints a one-time
warning to stderr.

`capture silent` has more than one cause — a virtual device with nothing behind
it, or microphone authorization the host has not granted. The file does not say
which, but it distinguishes all of them from a quiet room, which is what the
caller could not do before.

Backends without device enumeration report `unsupported`, and the emulator
follows the host default as it did before.

## Current GUI / Veltro Limitations (Future Work)

The final step — mounting the remote speech service — is **already supported** by the
Expand Down
Loading
Loading