Lewis Moten

Data Over Audio

Web Audio API

Data Over Audio

Sends text and binary files through sound using MFSK, packets, CRC checks, Hamming error correction, interleaving, and repeat requests.

Executive summary

Why it exists

The experiment's goal was to transfer text or a binary file using sound waves, between two browsers or on one device.

Outcome

Using only telephone frequencies (300 Hz to 3.4 kHz), one laptop alone reached just under 1 Kbps. Between a laptop and a mobile phone it was much slower: 138 bps for telephone frequencies and 538 bps for human hearing frequencies, and about half of that effective once error correction and packet headers are counted. It is a pure JavaScript app, with Vite only for local running.

My role

Author and maintainer.

Technical overview

How it works

Binary data is modulated with many oscillators using multi-frequency shift keying (MFSK), and the audio analyzer demodulates it again. Data is split into packets with CRC checks so failed packets can be discarded, Hamming codes so the receiver can try to repair a packet, and interleaving. An Automatic Repeat Request mode asks again for packets that failed, and the receiver lists packet errors.

Hard parts

I found the first packet often failed, and it carries the length header, so there is an option to send it twice. Sender and receiver must share the same frequencies, FSK pairs, packetization, and sampling period.

Stack

  • Web Audio API
  • JavaScript
  • MFSK
  • Error correction
  • Signal processing