import { spawnDetached } from "./node-compat/proc.js";
import { which } from "./node-compat/which.js";
export async function playSound() {
    const platform = process.platform;
    let command;
    switch (platform) {
        case 'darwin': {
            command = ['afplay', '/System/Library/Sounds/Blow.aiff'];
            break;
        }
        case 'linux':
            command = ['paplay', '/usr/share/sounds/freedesktop/stereo/complete.oga'];
            break;
        case 'win32':
            command = ['rundll32', 'user32.dll,MessageBeep', '0x00000040'];
            break;
        default:
            return;
    }
    const executable = command[0];
    if (process.stdout.isTTY && executable && (await which(executable))) {
        try {
            spawnDetached({ cmd: command });
        }
        catch {
            /* ignore */
        }
    }
}
//# sourceMappingURL=sound.js.map