lingo-free.openapps.xyz

Source

This app’s code and revision history are public. Download a copy or explore the files below.

Public
The app’s code and revision history are public.
Owned app · rev 8af89d2cc9f8
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 7efc97d0dde0b2a3e729ccf9
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
← All files
src/lib/sound.ts
// Small, soft sounds for right and wrong answers and a finished lesson, made on the fly (no audio files).
let ctx: AudioContext | null = null;

function tone(freq: number, start: number, length: number, type: OscillatorType, volume: number) {
  if (!ctx) return;
  const o = ctx.createOscillator();
  const g = ctx.createGain();
  o.type = type;
  o.frequency.value = freq;
  const t = ctx.currentTime + start;
  g.gain.setValueAtTime(0, t);
  g.gain.linearRampToValueAtTime(volume, t + 0.015);
  g.gain.exponentialRampToValueAtTime(0.0001, t + length);
  o.connect(g).connect(ctx.destination);
  o.start(t);
  o.stop(t + length + 0.05);
}

function ready(): boolean {
  try {
    ctx ??= new AudioContext();
    if (ctx.state === "suspended") void ctx.resume();
    return true;
  } catch {
    return false;
  }
}

export function chime(kind: "right" | "wrong" | "done") {
  if (!ready()) return;
  if (kind === "right") { tone(659.25, 0, 0.18, "sine", 0.09); tone(880, 0.09, 0.28, "sine", 0.08); }
  if (kind === "wrong") { tone(196, 0, 0.26, "triangle", 0.07); tone(174.6, 0.1, 0.3, "triangle", 0.06); }
  if (kind === "done") [523.25, 659.25, 783.99, 1046.5].forEach((f, i) => tone(f, i * 0.11, 0.35, "sine", 0.07));
}

Change history

Point OpenApps links to openapps.free
8af89d2cc9 · 17 hours ago
Bind agent address in policy
0018350275 · 19 hours ago
Use OpenApps service URLs and add contribution strip
805365daf4 · 19 hours ago
Bounded source sync
3f2fb3b265 · 2 days ago
Bounded source sync
7dcb580324 · 2 days ago
Bounded source sync
dcd05c0944 · 2 days ago