mirror of
https://github.com/R0m1k3/EveFlow.git
synced 2026-10-12 01:39:13 +02:00
Complete rewrite of the application: - Toolchain: Electron 44, Vite 8, React 19, TypeScript 5.9, Zustand, Vitest; main process rewritten in TypeScript (electron/), typed IPC contract (shared/), sandboxed renderer with webSecurity on and an HTTP/SSE proxy in the main process. - Voice: AudioWorklet microphone capture at 16 kHz with adaptive energy VAD and auto-stop, WAV encoder, OpenAI-compatible STT, TTS queue with sentence-level streaming, prefetch and Web Audio playback feeding an analyser; hands-free mode, global push-to-talk hotkey, system-voice fallback. - Hermes: full API client (capabilities, health, models, skills, toolsets, sessions, jobs) with automatic transport selection: runs API (SSE lifecycle, approvals, steer, stop) > sessions stream > chat completions with local tools; tolerant event normalisation; webhook receiver hardened (secret, size limit). - UI: JARVIS arc-reactor core on Canvas 2D reacting to the real audio signal, holographic HUD layout (transcript, core, Hermes ops panel with tools/crons/ skills/sessions/link tabs, telemetry), settings drawer, approval modals, compact floating widget, four themes, tray icon and global shortcuts. - Removed the 3D Eve robot, three.js and legacy assets; migrated 1.x settings. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Wn5VX9HNbJ7N54hR24u9Y
23 lines
930 B
TypeScript
23 lines
930 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { buildWav16k, encodeWav, resample } from '../src/services/voice/wav';
|
|
|
|
describe('wav', () => {
|
|
it('encodes a valid RIFF header at 16 kHz', () => {
|
|
const samples = new Float32Array(1600).fill(0.5);
|
|
const bytes = encodeWav(samples, 16000);
|
|
const view = new DataView(bytes.buffer);
|
|
expect(String.fromCharCode(...bytes.subarray(0, 4))).toBe('RIFF');
|
|
expect(view.getUint32(24, true)).toBe(16000);
|
|
expect(view.getUint16(34, true)).toBe(16);
|
|
expect(bytes.length).toBe(44 + 1600 * 2);
|
|
});
|
|
|
|
it('resamples 48k to 16k and builds a wav', () => {
|
|
const chunk = new Float32Array(4800).map((_, i) => Math.sin(i / 10) * 0.1);
|
|
const wav = buildWav16k([chunk, chunk], 48000);
|
|
expect(wav.sampleRate).toBe(16000);
|
|
expect(Math.round(wav.durationSec * 100)).toBe(20);
|
|
expect(resample(new Float32Array([0, 1]), 1, 2).length).toBe(4);
|
|
});
|
|
});
|