17 lines
833 B
JavaScript
17 lines
833 B
JavaScript
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import os from 'node:os';
|
|
|
|
export function voiceSettings() {
|
|
let config = {};
|
|
try { config = JSON.parse(fs.readFileSync(path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'jarvis/config.json'), 'utf8')); } catch {}
|
|
const phrase = config.wakePhrase || config.wake_phrase || 'hey jarvis';
|
|
const aliases = Array.isArray(config.aliases) ? config.aliases : ['jarvis', 'okay jarvis'];
|
|
return {
|
|
command: process.env.JARVIS_WAKE_COMMAND || config.wakeCommand || config.wake_command || '',
|
|
phrases: [phrase, ...aliases].map((item) => String(item || '').trim()).filter(Boolean),
|
|
ttsEnabled: config.ttsEnabled !== false && config.tts_enabled !== false,
|
|
modelProfile: config.modelProfile || config.model_profile || 'laptop-16gb',
|
|
};
|
|
}
|