https://github.com/ggerganov/ggwave#ggwave Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories - + Security - * Team * Enterprise * Explore + Explore GitHub - Learn & contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Nonprofit - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ggerganov / ggwave * Watch 9 * Star 213 * Fork 11 Tiny data-over-sound library youtu.be/zcgf77t71qm MIT License 213 stars 11 forks Star Watch * Code * Issues 3 * Pull requests 0 * Discussions * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Projects * Security * Insights master 3 branches 3 tags Go to file Code Clone HTTPS GitHub CLI [https://github.com/g] Use Git or checkout with SVN using the web URL. [gh repo clone ggerga] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit @ggerganov ggerganov update README-tmpl.md ... 95775bd Feb 10, 2021 update README-tmpl.md 95775bd Git stats * 240 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows ci : remove python 2.7 Jan 23, 2021 bindings ios : update submodule Jan 30, 2021 cmake Initial commit Nov 29, 2020 examples spectrogram : add simple spectrogram tool (#17) Feb 9, 2021 include/ggwave ggwave : add some more comments to the C interface Jan 25, 2021 media media : add HQ gif Jan 7, 2021 snap snap : bump version to 1.3.2 Jan 7, 2021 src ggwave : should improve recall success rate Feb 9, 2021 tests py : change file mode Jan 24, 2021 .clang-format add .clang-format Jan 10, 2021 .gitignore iOS SDK (#15) Jan 30, 2021 .gitmodules iOS SDK (#15) Jan 30, 2021 CHANGELOG.md Create CHANGELOG.md Dec 11, 2020 CMakeLists.txt iOS SDK (#15) Jan 30, 2021 LICENSE Create LICENSE Nov 29, 2020 README-tmpl.md update README-tmpl.md Feb 10, 2021 README.md Update README.md Feb 9, 2021 View code README.md ggwave Actions Status License: MIT ggwave badge pypi npm Tiny data-over-sound library. Click on the images below to hear what it sounds like: [waver-preview1] [ggwave0] [waver-0-fast] Details This library allows you to communicate small amounts of data between air-gapped devices using sound. It implements a simple FSK-based transmission protocol that can be easily integrated in various projects. The bandwidth rate is between 8-16 bytes/sec depending on the protocol parameters. Error correction codes (ECC) are used to improve demodulation robustness. This library is used only to generate and analyze the RAW waveforms that are played and captured from your audio devices (speakers, microphones, etc.). You are free to use any audio backend (e.g. PulseAudio, ALSA, etc.) as long as you provide callbacks for queuing and dequeuing audio samples. Possible applications: * Serverless, one-to-many broadcast * Device pairing * Authorization * Internet of Things * Audio QR codes Try it out You can easily test the library using the free waver application which is available on the following platforms: Download on the App Store Get it on Google Play Get it from the Snap Store Browser demos * https://waver.ggerganov.com * https://ggwave.ggerganov.com * https://ggwave-js.ggerganov.com HTTP service # audible example curl -sS 'https://ggwave-to-file.ggerganov.com/?m=Hello world!' --output hello.wav # ultrasound example curl -sS 'https://ggwave-to-file.ggerganov.com/?m=Hello world!&p=4' --output hello.wav Technical details Below is a short summary of the modulation and demodulation algorithm used in ggwave for encoding and decoding data into sound. Modulation (Tx) The current approach uses a multi-frequency Frequency-Shift Keying (FSK) modulation scheme. The data to be transmitted is first split into 4-bit chunks. At each moment of time, 3 bytes are transmitted using 6 tones - one tone for each 4-bit chunk. The 6 tones are emitted in a 4.5kHz range divided in 96 equally-spaced frequencies: Freq, Value, Freq, Value, ... Freq, Value, [Hz] [bits] [Hz] [bits] [Hz] [bits] F0 + Chunk 0: F0 + Chunk 1: ... F0 + Chunk 5: 00*dF 0000 16*dF 0000 80*dF 0000 F0 + Chunk 0: F0 + Chunk 1: ... F0 + Chunk 5: 01*dF 0001 17*dF 0001 81*dF 0001 F0 + Chunk 0: F0 + Chunk 1: ... F0 + Chunk 5: 02*dF 0010 18*dF 0010 82*dF 0010 ... ... ... ... ... ... ... F0 + Chunk 0: F0 + Chunk 1: ... F0 + Chunk 5: 14*dF 1110 30*dF 1110 94*dF 1110 F0 + Chunk 0: F0 + Chunk 1: ... F0 + Chunk 5: 15*dF 1111 31*dF 1111 95*dF 1111 For all protocols: dF = 46.875 Hz. For non-ultrasonic protocols: F0 = 1875.000 Hz. For ultrasonic protocols: F0 = 15000.000 Hz. The original data is encoded using Reed-Solomon error codes. The number of ECC bytes is determined based on the length of the original data. The encoded data is the one being transmitted. Demodulation (Rx) Beginning and ending of the transmission are marked with special sound markers (#13). The receiver listens for these markers and records the in-between sound data. The recorded data is then Fourier transformed to obtain a frequency spectrum. The detected frequencies are decoded back to binary data in the same way they were encoded. Reed-Solomon decoding is finally performed to obtain the original data. Examples The examples folder contains several sample applications of the library: Example Description Audio ggwave-rx Very basic receive-only program SDL ggwave-cli Command line tool for sending/receiving SDL data through sound ggwave-wasm WebAssembly module for web applications SDL ggwave-to-file Output a generated waveform to an - uncompressed WAV file waver GUI application for sending/receiving data SDL through sound ggwave-py Python examples PortAudio ggwave-js Javascript example Web Audio API spectrogram Spectrogram tool SDL Other projects using ggwave or one of its prototypes: * wave-gui - a GUI for exploring different modulation protocols * wave-share - WebRTC file sharing with sound signaling Building Dependencies for SDL-based examples [Ubuntu] $ sudo apt install libsdl2-dev [Mac OS with brew] $ brew install sdl2 [MSYS2] $ pacman -S git cmake make mingw-w64-x86_64-dlfcn mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 Linux, Mac, Windows (MSYS2) # build git clone https://github.com/ggerganov/ggwave --recursive cd ggwave && mkdir build && cd build cmake .. make # running ./bin/ggwave-cli Emscripten git clone https://github.com/ggerganov/ggwave --recursive cd ggwave mkdir build && cd build emcmake cmake .. make Python pip install ggwave More info: https://pypi.org/project/ggwave/ Node.js npm install ggwave More info: https://www.npmjs.com/package/ggwave iOS Available as a Swift Package: https://github.com/ggerganov/ggwave-spm Installing the Waver application Get it from the Snap Store Linux sudo snap install waver sudo snap connect waver:audio-record :audio-record Mac OS brew install ggerganov/ggerganov/waver About Tiny data-over-sound library youtu.be/zcgf77t71qm Topics python serverless ecc qrcode internet-of-things ultrasound fsk demodulation pairing sound-library data-over-sound Resources Readme License MIT License Releases 3 Waver v1.3.2 Latest Jan 11, 2021 + 2 releases Packages 0 No packages published Languages * C++ 77.1% * CMake 14.6% * Python 5.9% * Makefile 1.1% * Other 1.3% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.