import type { Page } from "puppeteer-core"; /** * Represents a single audio output device reported by the OS. */ export interface AudioDevice { /** The device name as reported by the OS (e.g., "Speakers (Realtek HD Audio)"). */ name: string; /** An OS-specific identifier for the device, if available. */ id?: string; } /** * Returns the list of audio output devices on the current platform. Results are cached for 60 * seconds to avoid repeated shell invocations. Returns an empty array on unsupported platforms or * when enumeration fails. */ export declare function enumerateAudioDevices(): Promise; /** * Finds the best-matching audio device for a partial name string. Matching is case-insensitive and * tries exact match first, then substring match. Returns undefined if no match is found. * @param devices - The list of available devices. * @param partialName - The partial device name from config (e.g., "Speakers", "HDMI"). */ export declare function findAudioDevice(devices: AudioDevice[], partialName: string): AudioDevice | undefined; /** * Logs available audio devices at startup and reports match status for any encoder that has an * audioDevice configured. * * On macOS, also advises installing SwitchAudioSource via Homebrew if it is not present, since * it provides a cleaner device list than the system_profiler fallback. * @param encoderDefs - The encoder definitions from encoders.json. */ export declare function logAudioDeviceInfo(encoderDefs: { audioDevice?: string; label?: string; }[]): Promise; /** * Routes audio output for all video elements on the page to the specified device using the Web * Audio API setSinkId(). Retries up to five times at one-second intervals to handle streaming * sites that create video elements asynchronously after page load. * * Requires the encoder browser to have been launched with --use-fake-ui-for-media-stream so that * navigator.mediaDevices.enumerateDevices() returns device labels without a permission prompt. * * @param page - The Puppeteer Page to apply audio routing on. * @param deviceName - The partial audio device name from config (same value used for findAudioDevice). * @returns true if setSinkId() was successfully applied to at least one video element. */ export declare function applySinkId(page: Page, deviceName: string): Promise;