INNER CODE UNIT · TypeScript
launchAudioHelper
jo-duchan/tapflow · packages/audiotap-helper/src/index.ts:92
export function launchAudioHelper(appPath: string, port: number, pids: number[]): void {
execFileSync('open', ['-g', '-n', '-a', appPath, '--args', String(port), ...pids.map(String)],
{ stdio: ['ignore', 'ignore', 'ignore'] })
}
/**
* Launch the helper in mute-only mode (Android host-mute symmetry, #341): it holds a `.muted` process
* tap on `pids` (the emulator/qemu process) to silence their host output, but captures/streams nothing
* — Android captures audio via gRPC. No port/socket. The helper self-exits once every target pid is
* gone (emulator stopped). `-n` forces a fresh instance so it never collides with the iOS capture helper.
*/
export function launchMuteOnlyTap(appPath: string, pids: number[]): void {
execFileSync('open', ['-g', '-n', '-a', appPath, '--args', '--mute-only', ...pids.map(String)],
{ stdio: ['ignore', 'ignore', 'ignore'] })
}
// Core Audio process taps need macOS 14.2+ (Darwin 23.2+). os.release() → "<darwinMajor>.<minor>.…".
export function isAudioSupported(): boolean {