iOS framework for the Quiet Modem (data over sound)

Overview

QuietModemKit

This is the iOS framework for https://github.com/quiet/quiet

With this library, you can send data through sound.

Live demo: https://quiet.github.io/quiet-js/

Other platforms:

Why sound? Isn't that outdated?

If you are old enough, you may remember using dial-up modems to connect to the internet. In a sense, this package brings that back. While it's true that this is somewhat of a retro approach, consider the advantages of using sound.

  • Highly cross-platform. Any device with speakers and a microphone and sufficient computational power can use this medium to communicate.

  • No pairing. Unlike Bluetooth, sound can be used instantly without the need to pair devices. This reduces the friction and improves the user experience.

  • Embeddable content. Similar to a QR code, short packets of data can be encoded into streaming or recorded audio and can then be later decoded by this package.

What does it sound like?

The answer to this depends on which operating mode you choose. Quiet provides audible and near-ultrasonic modes. Audible modes sound something like a puff of air. The near-ultrasonic modes run at 17+kHz and are virtually inaudible to adults. Either mode can operate at relatively low volumes as long as there isn't too much background noise.

How fast does it go?

Quiet's provided audible mode transfers at approximately 7kbps. In cases where two devices are connected over a cable (via 3.5mm jack) it can run in cable mode, which transfers at approximately 64kbps.

Building

CMake is required to build QuietModemKit. If you aren't sure if you have CMake installed, run brew install cmake.

It is recommended that you use Carthage to build QuietModemKit. Simply run brew install cmake and then add github "Quiet/QuietModemKit" to your Cartfile and run carthage update.

Example

Transmitter:

#import <QuietModemKit/QuietModemKit.h>

int main(int argc, char * argv[]) {
    QMTransmitterConfig *txConf = [[QMTransmitterConfig alloc] initWithKey:@"ultrasonic-experimental"];

    QMFrameTransmitter *tx = [[QMFrameTransmitter alloc] initWithConfig:txConf];

    NSString *frame_str = @"Hello, World!";
    NSData *frame = [frame_str dataUsingEncoding:NSUTF8StringEncoding];
    [tx send:frame];

    CFRunLoopRun();

    [tx close];

    return 0;
}

Receiver:

#import <QuietModemKit/QuietModemKit.h>

static QMFrameReceiver *rx;

void (^recv_callback)(NSData*) = ^(NSData *frame){
    printf("%s\n", [frame bytes]);
};

void (^request_callback)(BOOL) = ^(BOOL granted){
    QMReceiverConfig *rxConf = [[QMReceiverConfig alloc] initWithKey:@"ultrasonic-experimental"];
    rx = [[QMFrameReceiver alloc] initWithConfig:rxConf];
    [rx setReceiveCallback:recv_callback];
};

int main(int argc, char * argv[]) {
    [[AVAudioSession sharedInstance] requestRecordPermission:request_callback];

    CFRunLoopRun();

    if (rx != nil) {
        [rx close];
    }

    return 0;
}

Note that we ask for the Record permission. This is required to use the receiver.

Profiles

The modem can be used audibly or via ultrasonic sound. QMTransmitterConfig and QMReceiverConfig are used to select modem configuration. For a full list of valid keys, refer to the top-level keys of quiet-profiles.json.

License

3-Claused BSD, plus third-party licenses (mix of MIT and BSD, see licenses/)

Comments
  • Library not working?

    Library not working?

    Hello, I tried to create a small project with this library, I did setup two versions of the app one for receiver and another for the transmitter. I installed in two devices running iOS 10 and I never got a callback in the receiver end even though no crashes or errors were reported in the transmitter app.

    Can you help?

    opened by arctouch-pedrocosta 17
  • Unable to build

    Unable to build

    Hello! I'm trying to build framework using Carthage and unable to successfully do that. Here is the output log : https://gist.github.com/xzenon/e342865614ae0d482ddc1a86947fc9be

    Error message says:

    libquiet requires libliquid but cannot find it
    
      fetch the devel branch using
    
          git clone https://github.com/quiet/liquid-dsp.git -b devel --single-branch
    
      and install it before continuing
    

    I've fetched libliquid sources, compiled and installed it manually but still unable to compile QuietModem.

    Would be great if you can advice something. Thanks!

    opened by xzenon 9
  • Which branch?

    Which branch?

    @brian-armstrong Hi, I am happy to use this nice kit. I am currently trying to use this repository but I see there is much difference in "devel" and "master"branch. Which one is correct to use?

    Thanks

    opened by perfectdeveloper53 7
  • Error carthage update

    Error carthage update

    Hi!

    There was a problem during installation. (Using Xcode 8.3.2)

    $ carthage update --verbose
    
    *** Fetching QuietModemKit
    *** Checking out QuietModemKit at "v0.1.5"
    
    ... ...
    
    Undefined symbols for architecture arm64:
      "_quiet_encoder_close", referenced from:
          -[QMFrameTransmitter close] in QMFrameTransmitter.o
      "_quiet_encoder_set_nonblocking", referenced from:
          -[QMFrameTransmitter setNonBlocking] in QMFrameTransmitter.o
      "_quiet_encoder_send", referenced from:
    ... ...
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    or 
    
    Undefined symbols for architecture armv7:
      "_quiet_encoder_close", referenced from:
          -[QMFrameTransmitter close] in QMFrameTransmitter.o
      "_quiet_encoder_set_nonblocking", referenced from:
          -[QMFrameTransmitter setNonBlocking] in QMFrameTransmitter.o
      "_quiet_encoder_send", referenced from:
    ... ...
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    

    What should I do?

    Help me

    opened by JosephNK 5
  • Archive - Failed to verify bitcode

    Archive - Failed to verify bitcode

    I am trying to archive but it fails. My Xcode version is 10.2.1, I have this framework latest one v0.2. I posted the screenshot of the issue. Please advise if anyone already facing it. Where I miss? Issue

    opened by antonyjamese 1
  • Build Failure - Xcode 13.4.1 / CMake

    Build Failure - Xcode 13.4.1 / CMake

    I've been trying out the library, which I have working on Android, but am running into issues when trying to build on iOS. I'm using Xcode 13.4.1 (13F100), with CMake version 3.23.2 installed via brew.

    I've run through the following steps to get the dependencies compiled:

    1. Carthage install $ brew update $ brew install carthage

    2. Liquid DSP $ brew install cmake $ brew install automake $ git clone https://github.com/quiet/liquid-dsp.git -b devel --single-branch $ cd liquid-dsp $ autoupdate $ ./bootstrap.sh $ ./configure $ make $ sudo make install

    3. libfec $ git clone https://github.com/quiet/libfec.git $ cd libfec $ ./configure --build=x86_64-apple-darwin15.0.0 $ make $ sudo make install

    4. Jansson $ brew install libtool $ git clone https://github.com/akheron/jansson.git $ cd jansson $ autoreconf -i $ ./configure $ make $ make install

    5. portaudio $ git clone https://github.com/PortAudio/portaudio $ cd portaudio $ ./configure $ make $ make install

    6. libsndfile $ download from http://www.mega-nerd.com/libsndfile/#Download $ cd libsndfile $ ./configure $ make $ sudo make install

    7. quiet-lwip $ git clone https://github.com/quiet/quiet-lwip.git $ cd quiet-lwip $ mkdir build $ cd build $ cmake .. $ copy headers from portaudio, quiet-portaudio, and quiet into include directory. $ make

    8. libcorrect $ git clone https://github.com/quiet/libcorrect.git $ cd libcorrect $ mkdir build $ cd build $ cmake .. $ make $ make install

    9. quiet $ git clone https://github.com/quiet/quiet $ cd quiet $ ./bootstrap $ cd build && make install

    When I attempt to build the framework via:

    xcodebuild -configuration Debug build

    I am getting multple errors, including "libquiet requires libliquid but cannot find it". I've checked my path settings, and checked my included headers. If you could provide any insight I would greatly appreciate it. I've attached the full xcodebuild output for reference.

    @brian-armstrong have you considered enabling sponsorship for this project? I would be interested in contributing financially, or in other ways to support it's development. Thank you for your hard work on this.

    xcodebuild.txt

    opened by ninehundreds 0
  • Build Error: clang: error: unknown argument: '-='

    Build Error: clang: error: unknown argument: '-='

    hey @brian-armstrong, I'm running into an error while trying to build QM. I get the following error while running a carthage update command:

    Run Build Command(s):/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile cmTC_2607f/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_2607f.dir/build.make CMakeFiles/cmTC_2607f.dir/build
    Building C object CMakeFiles/cmTC_2607f.dir/INT.c.o
    /usr/bin/clang   -=  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk  -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk -MD -MT CMakeFiles/cmTC_2607f.dir/INT.c.o -MF CMakeFiles/cmTC_2607f.dir/INT.c.o.d -o CMakeFiles/cmTC_2607f.dir/INT.c.o -c /Users/cmassoudi/Library/Caches/org.carthage.CarthageKit/DerivedData/14.0.1_14A400/QuietModemKit/v0.3.2/Build/Intermediates.noindex/ArchiveIntermediates/QuietModemKit/BuildProductsPath/Release-iphoneos/jansson/CMakeFiles/CheckTypeSize/INT.c
    clang: error: unknown argument: '-='
    

    That unknown arg error (clang: error: unknown argument: '-=') made it seem like some env variables might be missing. I took a peek at the apple.toolchain.make and I see the cmake flags have an arg APPLE_VERSION_FLAG- I think that's the culprit.

    apple.toolchain.make L195
    
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${APPLE_VERSION_FLAG} ${BITCODE_FLAG} -isysroot ${CMAKE_OSX_SYSROOT}" CACHE STRING "")
    

    Any help would be much appreciated, thanks! -Cam

    opened by cmassoudi 1
  • Issue with the app store

    Issue with the app store

    Hi, As you can see on my previous issue : https://github.com/cawfree/react-native-quiet/issues/9

    I was playing with this library and I realized that the app is rejected by App Connect because the file build-c-libraries.sh from QuietModemKit is not signed.

    I get a message like this :

    Invalid Signature. Code object is not signed at all
    

    Do you have any idea how to solve this issue ?

    opened by Daavidaviid 0
  • Crash on iPhone

    Crash on iPhone

    Hi Brian, I can able to transfer data using Quiet framework in iOS. But consistently app is crashing in iOS due to below error message. I think this is related incorrect memory access. But I didn't do any code changes related to memory issue. Can you please help on this? You can find the code if required https://github.com/chanduthedev/iOS/tree/master/QuietShare

    Error log:

    2019-05-06 11:39:28.695414+0800 TestSoundPayment[745:112219] In receive profile :ultrasonic-experimental TestSoundPayment(745,0x104cfebc0) malloc: Incorrect checksum for freed object 0x10581f000: probably modified after being freed. Corrupt value: 0x0 TestSoundPayment(745,0x104cfebc0) malloc: *** set a breakpoint in malloc_error_break to debug (lldb)

    Crash backtrace:

    Screenshot 2019-05-06 at 11 41 25 AM
    opened by chanduthedev 13
  • is there any way to stop scanning once text received?

    is there any way to stop scanning once text received?

    Hi Brian, I am developing iOS native app for sending data between android and iOS devices using Quite framework. I can able to send/receive successfully. If the app is in receiving mode, I cant have a control to stop the receiving mode. is there any way to stop/start receiving mode. I can able to do start/stop sending mode. Please check https://github.com/chanduthedev/iOS/tree/master/QuietShare repo if code reference needed.

    opened by chanduthedev 0
  • How to increase the distance?

    How to increase the distance?

    I am trying to find a way to check how far can the signal be detected while keeping the lowest possible volume. How can I do that? For me the data is small, so speed is not a very big issue.

    opened by heroic 1
Releases(v0.3.2)
Owner
Quiet Modem Project
Quiet Modem Project
PitchPerfect - A simple iOS app for the Udacity Nanodegree which explores AVFoundation to record a short sound

PitchPerfect App A simple iOS app for the Udacity Nanodegree which explores AVFo

Mark Han 0 Feb 12, 2022
AudioKit Sample Player (ROM Player) - EXS24, Sound Font, Wave Player

AudioKit ROM / Sample Player Welcome to the official AudioKit example of a sample-based music instrument written in Swift. It can be modified to play

AudioKit 500 Dec 27, 2022
OSCKit - The OSCKit package provides the classes needed for your apps to communicate among computers, sound synthesizers

OSCKit The OSCKit package provides the classes needed for your apps to communica

Sammy Smallman 23 Nov 27, 2022
Contains common infrastructural code for apps to communicate among computers, sound synthesizers, and other multimedia devices via OSC.

The CoreOSC package contains common infrastructural code for your apps to communicate among computers, sound synthesizers, and other multimedia devices via OSC.

Sammy Smallman 3 Oct 7, 2022
Play and share sound inserts from Medo e Delírio em Brasília, a Brazilian podcast.

Play and share sound inserts from Medo e Delírio em Brasília, a Brazilian podcast.

Rafael Schmitt 18 Dec 26, 2022
AudioPlayer is syntax and feature sugar over AVPlayer. It plays your audio files (local & remote).

AudioPlayer AudioPlayer is a wrapper around AVPlayer. It also offers cool features such as: Quality control based on number of interruption (buffering

Kevin Delannoy 676 Dec 25, 2022
Radio Streams from all over the world. Free and Open.

RadioBrowserKit - The Swift SDK for Radio Browser Radio Streams from all over the world. Free and Open. RadioBrowserKit is a Swift package which lets

Frank Gregor 5 Oct 17, 2022
:musical_keyboard: A simple iOS synthesiser powered by Pure Data. Based on the Korg Monotron Delay.

Monotone Delay A simple iOS Synthesizer based on Pure Data. You can see a short demo of the app on youtube. If you want to buy the app you can find it

Justus Kandzi 17 Oct 16, 2022
Extensions and classes in Swift that make it easy to get an iOS device reading and processing MIDI data

MorkAndMIDI A really thin Swift layer on top of CoreMIDI that opens a virtual MIDI destination and port and connects to any MIDI endpoints that appear

Brad Howes 11 Nov 5, 2022
An iOS and macOS audio visualization framework built upon Core Audio useful for anyone doing real-time, low-latency audio processing and visualizations.

A simple, intuitive audio framework for iOS and OSX. Deprecated EZAudio has recently been deprecated in favor of AudioKit. However, since some people

Syed Haris Ali 4.9k Jan 2, 2023
The Amazing Audio Engine is a sophisticated framework for iOS audio applications, built so you don't have to.

Important Notice: The Amazing Audio Engine has been retired. See the announcement here The Amazing Audio Engine The Amazing Audio Engine is a sophisti

null 523 Nov 12, 2022
iOS framework that enables detecting and handling voice commands using microphone.

iOS framework that enables detecting and handling voice commands using microphone. Built using Swift with minumum target iOS 14.3.

Ahmed Abdelkarim 20 Aug 4, 2022
MusicKit is a framework and DSL for creating, analyzing, and transforming music in Swift.

MusicKit MusicKit is a framework and DSL for creating, analyzing, and transforming music in Swift. Examples Functional harmony let C5 = Pitch(midi: 72

Ben Guo 591 Oct 18, 2022
A speech recognition framework designed for SwiftUI.

SwiftSpeech Speech Recognition Made Simple Recognize your user's voice elegantly without having to figure out authorization and audio engines. SwiftSp

cayZ 297 Dec 17, 2022
SoundManager - A simple framework to load and play sounds in your app.

SoundManager - A simple framework to load and play sounds in your app.

Jonathan Chacón 3 Jan 5, 2022
Functional DSP / Audio Framework for Swift

Lullaby Lullaby is an audio synthesis framework for Swift that supports both macOS and Linux! It was inspired by other audio environments like FAUST,

Jae 16 Nov 5, 2022
M3UKit - A µ framework for parsing m3u files

M3UKit - A µ framework for parsing m3u files

Omar Albeik 32 Dec 28, 2022
Background sounds feature from iOS 15 on iOS 11+

Tranquil Background sounds feature from iOS 15 on iOS 11+ Only physically tested on iOS 14.3 and iOS 12.1.2, but it should support iOS 11 - iOS 15.x (

Dana Buehre 4 Dec 15, 2022
AudiosPlugin is a Godot iOS Audio Plugin that resolves the audio recording issue in iOS for Godot Engine.

This plugin solves the Godot game engine audio recording and playback issue in iOS devices. Please open the Audios Plugin XCode Project and compile the project. You can also use the libaudios_plugin.a binary in your project.

null 3 Dec 22, 2022