Skip to content

africamonkey/SoundLink

Repository files navigation

SoundLink

unit-test

SoundLink enables data transfer through audio signals. It encodes messages into audio waveforms and decodes them back, using the speaker and microphone as the transmission medium.

Demo

output.mp4
2026-04-05.22-56-26.mp4

Architecture

Sender                          Receiver
  |                                ^
  |  Encode + Play                 |  Capture + Decode
  v                                |
[Encoder] ---- audio -----> [Encoder]

Quick Start

Dependencies

For Ubuntu

Make sure that all the required packages are installed (on Debian):

sudo apt-get update
sudo apt-get install -y portaudio19-dev

For Mac

Install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install portaudio

# Use Homebrew to install latest PortAudio (for ARM)
arch -arm64 brew install portaudio

# Validate PortAudio path
brew --prefix portaudio  # Example: /opt/homebrew/opt/portaudio

Sender

bazel run //src/sender:sender_main

Receiver

bazel run //src/receiver:receiver_main

Configuration

Parameters are defined in params/encoder_params_prod.txt.

Build

# Build all targets
bazel build //...

# Build specific target
bazel build //src/demo

# Build with AddressSanitizer
bazel build --config=asan //...

Test

# Run all tests
bazel test //...

# Run specific test
bazel test //src/wav:wav_writer_test

# Run with full output
bazel test --test_output=all //...

# Run with AddressSanitizer
bazel test --config=asan --test_output=errors //...

Components

Component Description
Encoder Encodes/decodes data to/from audio samples. Supports multiple algorithms (simple, Goertzel, chirp).
Audio Cross-platform audio playback and capture using PortAudio.
Sender High-level module that encodes and transmits messages via speakers.
Receiver High-level module that captures audio and decodes messages via microphone.
Protocol Frame structure with preamble, length, checksum for reliable transmission.
WAV WAV file read/write utilities for audio file handling.

Dependencies

  • Bazel - Build system
  • PortAudio - Cross-platform audio I/O (sudo apt-get install portaudio19-dev)
  • Google Test - Unit testing
  • Google Logging - Logging
  • Protocol Buffers - Data serialization

About

Data transfer through audio signals

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors