ggwave-rs
Rust bindings and a small safe wrapper for ggwave, a library that encodes short payloads into audio waveforms.
Features
- Safe
GgWavewrapper for init/encode/decode - Raw C FFI bindings available under
ggwave_rs::ffi - Build with a vendored upstream copy (default) or a system
libggwave - CLI tool with WAV file support for encode/decode
Requirements
- Rust toolchain (edition 2021)
- Vendored build: a C++11 toolchain
- System build:
libggwave+pkg-configavailable on your system
Getting the sources
This repo tracks ggwave as a submodule under vendor/ggwave:
Build
This is a Cargo workspace with two crates:
ggwave-rs— the libraryggwave-cli— the command-line tool
Build everything (vendored, default):
Build with system library:
Note: the system libggwave must be built with the full protocol set
(i.e. without GGWAVE_CONFIG_FEW_PROTOCOLS / Arduino configs).
CLI usage
The CLI reads and writes standard WAV files:
# Build and install the CLI
# Encode a message to a WAV file
# Decode a message from a WAV file
Available protocols: audible-normal, audible-fast, audible-fastest,
ultrasound-normal, ultrasound-fast, ultrasound-fastest,
dt-normal, dt-fast, dt-fastest, mt-normal, mt-fast, mt-fastest
Library usage
use ;
let params = default_parameters;
let ggwave = new?;
let waveform = ggwave.encode?;
if let Some = ggwave.decode?
# Ok::
Updating the submodule
License
This crate is MIT licensed. Upstream ggwave is also MIT licensed.