Skip to main content

audio

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Capture what the device plays: start, stop with a path to save it as a WAV, or omit the action to ask whether a capture is running. These call app_audio.

audio​

audio(options?: { action?: 'start' | 'stop'; path?: string; expect?: { hz: number; min_ms?: number; max_ms?: number }[]; ignoreMs?: number; app?: string }): Promise<Data>

Capture what the device plays; stop with a path saves a WAV and resolves to its timeline. An Android emulator or an iOS simulator.

Examples​

Start capturing what an app plays​

await device.audio({ action: 'start', app: 'dev.mobium.mobiumapp' })

The same call from the command line, mobium audio start --app dev.mobium.mobiumapp, printed on an Android 15 emulator:

capturing audio — stop it with action "stop" and a path

Stop, save the capture, and assert what was heard​

const heard = await device.audio({ action: 'stop', path: 'heard.wav', expect: [{ hz: 440 }] })
console.log(heard.timeline)

The same call from the command line, mobium audio stop -o heard.wav --expect 440, printed on an Android 15 emulator:

saved …/heard.wav: 3.746s of audio: 0.0–0.5s silence, 0.5–0.6s sound, no one pitch (-46 dBFS), 0.6–2.6s 440 Hz (-42 dBFS), 2.6–3.7s silence — at media volume 5 of 15