React-Sonic
React components to transmit and receive messages through ultrasonic sound.
A ReactJs implementation of an awesome library sonicnet.js by Boris Smus. Here is the video and his blog post on ultrasonic networking.
Run Example
$ npm install
$ npm start
Components
SonicSocket
Encodes text as audio streams.
- Receives a string of text.
- Creates an oscillator.
- Converts characters into frequencies.
- Transmits frequencies, waiting in between appropriately.
props
- charDuration
- rampDuration
SonicServer
Extracts meaning from audio streams
- Listen to the microphone.
- Do an FFT on the input.
- Extract frequency peaks in the ultrasonic range.
- Keep track of frequency peak history in a ring buffer.
- Call back when a peak comes up often enough.
props
- peakThreshold
- minRunLength
- timeout