Skip to content

Repository files navigation

Acoustic Data Link

A browser-based acoustic data link for air-gapped, peer-to-peer transmission using device audio hardware. Built with React and the Web Audio API, it encodes text and files into 8-FSK audio signals to transmit data wirelessly over sound waves.

What This Does

This project allows two devices to communicate with each other completely offline and without any RF network (Wi-Fi, Bluetooth, Cellular). It uses the device's built-in speaker to emit a sequence of musical tones (Frequency-Shift Keying) and the receiving device's microphone to listen to and decode those tones back into digital data. It is capable of transmitting both short text payloads and small files across an air gap.

Features

  • 8-FSK Modulation: Encodes 3 bits of data per audio symbol using 8 distinct frequencies.
  • True Sync Preamble: Uses a robust synchronization protocol to lock onto the transmission perfectly, discarding Javascript timer drift.
  • SNR-Based Handshake Detection: Analyzes Signal-to-Noise Ratio to prevent false triggers from ambient room noise.
  • Data Integrity: All payloads are verified upon receipt using CRC32 checksums.
  • "Dead Frequency" UI: A custom, vintage signal intelligence aesthetic with a warm parchment/amber/teal palette, DM Serif Display typography, and kinetic CSS animations.

Tech Stack

  • Frontend Framework: React 18 + Vite
  • Styling & Motion: Tailwind CSS + Framer Motion (for kinetic elements and page transitions)
  • Audio Processing: Native Web Audio API (AudioContext, AnalyserNode, OscillatorNode)
  • Icons: Lucide React

Getting Started

Prerequisites

  • Node.js (v18+)
  • npm or yarn

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm run dev

Note: For the acoustic link to work, the transmitting device needs a functioning speaker, and the receiving device needs a functioning microphone and must grant microphone permissions in the browser.

How It Works

  1. Encoding: The application takes a text string or a file buffer and chunks it into smaller packets. Each packet calculates a CRC32 checksum. The binary data is then mapped to 8 specific audio frequencies (8-FSK).
  2. Transmission: The transmitter broadcasts a dual-tone handshake to wake up any nearby receivers, followed by a known Sync Preamble, and then the actual payload frequencies using precisely scheduled Web Audio API OscillatorNodes (Look-Ahead scheduling).
  3. Decoding: The receiver continuously polls audio data via an AnalyserNode performing Fast Fourier Transforms (FFT). It detects the handshake using SNR, precisely aligns itself using the Sync Preamble, and then records the strongest frequencies over time to rebuild the packet.
  4. Verification: Once a packet is received, its CRC32 is checked. If it matches, the data is pushed to the final payload.

Acoustic Packet Structure

Each transmission is stripped into 64-byte maximum payloads and wrapped in a 10-byte protocol envelope before being sent over the air as FSK audio:

SegmentSizeDescription
chunkIndex2 bytesThe 0-based index of the current chunk
totalChunks2 bytesTotal count of chunks in the transmission
payloadLen2 bytesLength of the data payload in this packet
payload0-64 bytesThe raw data payload slice
crc324 bytes32-bit checksum of the header and payload

FSK Frequency Map

Symbol (3-bit)Value / TypeFrequency (Hz)Notes
00001400 HzLowest data frequency
10011800 HzAlso used in Sync Preamble
20102200 Hz
30112600 Hz
41003000 Hz
51013400 HzAlso used in Sync Preamble
61103800 Hz
71114200 HzHighest data frequency

Control Tones

TypeFrequencyDescription
Handshake A900 HzOutside FSK range, wake-up tone
Handshake B1050 HzOutside FSK range, wake-up tone
EOT700 HzEnd-of-transmission, below FSK range

Limitations & Future Ideas

  • Bitrate: Current speeds are around ~37 bps. Future versions will optimize the DSP loop to increase throughput.
  • Distance: Environmental noise heavily impacts reliability. Devices must be relatively close in a quiet room for uncorrupted transmission. Error correction coding (like Reed-Solomon) is planned to recover flipped bits automatically.

Deployment

This repository includes a GitHub Action for deploying natively to GitHub Pages (.github/workflows/deploy.yml).

Developed by Asmith — asmyth@duck.com

About

A browser-based acoustic data link for air-gapped, peer-to-peer transmission using device audio hardware. Built with React and the Web Audio API, it encodes text and files into 8-FSK audio signals to transmit data wirelessly over sound waves. Features a custom FSK protocol, CRC32 verification, and a distinctive vintage signal intelligence UI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages