INNER CODE UNIT · TypeScript
isAudioSupported
jo-duchan/tapflow · packages/audiotap-helper/src/index.ts:109
export function isAudioSupported(): boolean {
const [maj, min] = os.release().split('.').map(Number)
return maj > 23 || (maj === 23 && min >= 2)
}
/**
* Prime the audio-capture TCC grant up front (from `tapflow setup ios` / `tapflow agent start`) so the
* operator approves it while present — not at first simulator boot, which a headless operator would miss.
*
* Runs the helper's --request-permission mode: a global tap whose *capture start* raises the same
* audio-capture prompt a per-pid tap needs (the grant keys on the app cdhash + service, not the tap
* shape), so no port/pid/booted simulator is required. The grant isn't readable back, so the caller
* treats a clean return as "prompt shown / answered" and leaves approve-vs-deny to the operator.
*
* `wait` (default true, for `tapflow setup ios`): `open -W` blocks until the modal is answered.
* `wait=false` (for `tapflow agent start`): fire-and-forget so agent startup isn't blocked — if the
* grant exists the helper exits silently, otherwise the modal pops for the operator to allow.
*/