import { type AudioCaptureOpener, type AudioCaptureWarn } from './types.js'; /** The narrow slice of a child process this needs. Matches Node and Bun spawns. */ export interface CaptureChildProcess { readonly stdout: { on(event: 'data', listener: (chunk: Uint8Array) => void): unknown; } | null; readonly stderr?: { on(event: 'data', listener: (chunk: Uint8Array) => void): unknown; } | null | undefined; on(event: 'error', listener: (error: Error) => void): unknown; on(event: 'close', listener: (code: number | null, signal: string | null) => void): unknown; kill(signal?: string): unknown; } /** Spawns a recorder. A host passes `node:child_process`'s spawn, wrapped. */ export type CaptureSpawn = (command: string, args: readonly string[]) => CaptureChildProcess; export interface RecorderCaptureOptions { readonly spawn: CaptureSpawn; /** True when a command is on PATH. A host checks with `X_OK` access. */ readonly isInstalled: (command: string) => boolean; /** `process.platform`; decides ffmpeg's input format. */ readonly platform?: string | undefined; /** * True only when the caller filters this recorder's frames ITSELF. * * A recorder subprocess produces raw audio and this module does not filter it. * The platform's suppression stage does, one layer up: * `createNoiseSuppressingOpener` wraps an opener like this one, and both * consumers, {@link WakeListener} and {@link PushToTalkSession}, already * wrap the opener a host hands them, which is why a host passes nothing here * and still gets `voice.wake.noiseSuppression: "speex"` applied. * * A caller driving this opener DIRECTLY with `speex` and no filter of its own * is refused rather than served unfiltered audio, which is what this flag * exists to distinguish. */ readonly speexAvailable?: boolean | undefined; readonly sampleRate?: number | undefined; readonly warn?: AudioCaptureWarn | undefined; } /** * Build a capture opener over a recorder subprocess. * * The returned opener rejects with an {@link AudioCaptureError} when nothing can * be opened, and reports a stream that dies later through * {@link AudioCaptureHandlers.onStopped}, the distinction matters because the * first is "this will never work as configured" and the second is what the * detector's restart policy exists to handle. */ export declare function createRecorderCaptureOpener(options: RecorderCaptureOptions): AudioCaptureOpener; //# sourceMappingURL=recorder-source.d.ts.map