30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
import { voiceSettings } from './voice-settings.js';
|
|
import { ttsConfiguration } from './tts-config.js';
|
|
import { isBuiltinWakeCommand } from './wake-engine.js';
|
|
import { access } from 'node:fs/promises';
|
|
|
|
const commandAvailable = async (command) => {
|
|
for (const dir of ['/usr/bin', '/usr/local/bin', '/bin']) {
|
|
try { await access(`${dir}/${command}`); return true; } catch {}
|
|
}
|
|
return false;
|
|
};
|
|
const pipewire = await commandAvailable('pw-cat');
|
|
const settings = voiceSettings();
|
|
const report = {
|
|
pipewireCapture: pipewire,
|
|
wakeEngine: settings.listeningMode !== 'ptt' && Boolean(settings.command),
|
|
wakeCommand: settings.command || null,
|
|
wakeBuiltin: settings.listeningMode !== 'ptt' && isBuiltinWakeCommand(settings.command),
|
|
sampleRate: 16000,
|
|
channels: 1,
|
|
ttsPlayback: pipewire,
|
|
microphoneEnabled: settings.microphoneEnabled,
|
|
inputTarget: settings.inputTarget || 'system default',
|
|
outputTarget: settings.outputTarget || 'system default',
|
|
speech: settings.ttsEnabled ? ttsConfiguration(settings) : 'disabled',
|
|
gpuRequired: true,
|
|
};
|
|
console.log(JSON.stringify(report, null, 2));
|
|
if (!report.pipewireCapture) process.exitCode = 1;
|