Public
Type text, hear it as ggwave chirps (GibberLink-style)
audioggwavetoy
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

text-to-gibberlink

Type text, hear it as ggwave chirps — the data-over-sound protocol behind the viral GibberLink "two AI agents switch to beeps" demo.

Everything runs client-side: ggwave's single-file WASM build (proxied same-origin at /vendor/ggwave.js) encodes text into an FSK waveform, the Web Audio API plays it, and a small hand-rolled WAV encoder makes it downloadable.

Files

  • main.ts — Hono server: serves the frontend, /source redirect
  • frontend/index.html — page shell, loads ggwave.js from CDN as a global
  • frontend/app.js — encode, play, WAV download, speech synthesis
  • frontend/encodings.js — proquint + bubble babble encoders (spec-vector tested)
  • frontend/whistle.js — whistle protocol: 8-note codec, sine synth, mic FFT detector
  • frontend/learn.html + frontend/learn.js — gibberwhistle school at /learn (hear a phrase, whistle it back, get graded per note)
  • frontend/hum.js — hum-whistle duet: 4x4 bins, duet chord synth, dual detector (autocorrelation for the hum, spectral peak for the whistle)
  • frontend/duet.html + frontend/duet.js — duet trainer at /duet (hold the target hum+whistle chord to score; 16 chords = hex digits)
  • frontend/style.css — black ink + Bic 4-colour accents

Notes

  • Max payload is 140 bytes per transmission (ggwave limit); the byte counter turns red past that
  • Protocols: audible / ultrasound / dual-tone, each in normal / fast / fastest
  • Decode chirps back to text with any ggwave receiver, e.g. waver
  • Speakable encodings: proquints (16 bits per CVCVC quint) and Bubble Babble (ported from OpenSSH's fingerprint code, includes checksum) re-spell the raw UTF-8 payload bytes for a human voice; speak buttons use the Web Speech API. Note these encode the raw bytes, whereas the chirps carry Reed-Solomon-coded frames.
  • Whistle protocol (/learn): 8 pitch bins = the C6 major scale (do re mi fa sol la si do'), 3 bits per note, ~2 bits/s at 400ms notes. Human whistles are near-pure sinusoids, so a plain FFT peak detector (fftSize 4096, ~11.7 Hz bins, band 900-2300 Hz) quantizes to the nearest note with onset gating. Inspired by whistled languages (Silbo Gomero) and Solresol. Detector thresholds live at the top of whistle.js if a noisy room needs tuning.