Files
faceclaw/tests/wav-header.test.cjs
FilipAlexanderandClaude Opus 5.5 e2caf28392 Voice: self-hosted Whisper server provider; Transcribe on iOS
- "Whisper server (self-hosted)" transcription provider for OpenAI-compatible
  Whisper servers (vLLM, speaches, LocalAI) over plain HTTP batch requests,
  with URL, model, language and key settings (Voice). Pause-ended spans are
  one request each, finalized in audio order, with provisional text while a
  span is open. See notes/whisper-server.md.
- Transcribe (and other continuous capture) works on iOS with a cloud or
  Whisper-server provider; push-to-talk shares a running capture.
- Transcribe saves each session's audio as transcribe-<time>.wav in Downloads
  (setting "Save Transcribe audio", on by default), written as it is captured
  so a crash leaves a playable file; a saved transcript uses the same stamp.
- Calculator stops continuous listening when its window closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:43:18 +02:00

20 lines
889 B
JavaScript

const test = require('node:test');
const assert = require('node:assert/strict');
const { loader } = require('./helpers/load-typescript.cjs');
test('the WAV header describes 16 kHz mono PCM16 and its data size', () => {
const { wavHeader } = loader({ DataView }, {})('app/native/wav-header.ts');
const header = Buffer.from(wavHeader(32000));
assert.equal(header.length, 44);
assert.equal(header.toString('ascii', 0, 4), 'RIFF');
assert.equal(header.readUInt32LE(4), 36 + 32000);
assert.equal(header.toString('ascii', 8, 16), 'WAVEfmt ');
assert.equal(header.readUInt16LE(20), 1);
assert.equal(header.readUInt16LE(22), 1);
assert.equal(header.readUInt32LE(24), 16000);
assert.equal(header.readUInt32LE(28), 32000);
assert.equal(header.readUInt16LE(34), 16);
assert.equal(header.toString('ascii', 36, 40), 'data');
assert.equal(header.readUInt32LE(40), 32000);
});