Audio spatialization over WebRTC and JACK Audio Connection Kit

Related tags

Audio spatify
Overview

Audio spatialization over WebRTC

Spatify provides a framework for building multichannel installations using WebRTC.

With Spatify each client becomes a JACK client on the host machine, any audio sent to that client's ports will be streamed over WebRTC to the client.

The original idea behind this project was to use multiple smartphones as individual speakers in installations or performances.

Installing

You will need Python >= 3.7 together with websockets and aiortc python libraries.

$ git clone [email protected]:bgola/spatify.git
$ cd spatify/
$ pip install websockets aiortc
$ python setup.py install

Running

$ spatify -h
usage: spatify [-h] [--cert CERT] [--key KEY] [--host HOST] [--port PORT] [--verbose] [--quiet]

Spatify server

optional arguments:
  -h, --help     show this help message and exit
  --cert CERT    SSL certificate path (for WSS)
  --key KEY      SSL key path (for WSS)
  --host HOST    Host for WebSocket server (default: 0.0.0.0)
  --port PORT    Port for WebSocket server (default: 8765)
  --verbose, -v
  --quiet, -q

Checking the example

In the examples/ folder there is an HTML/JavaScript example for using WebSockets as signaling mechanism and estabilishing the WebRTC streams. Notice that the example uses a self-signed SSL certificafe because you can't start the WebRTC stream over an unsecured connection (you need HTTPS). Your browser might complain that the certificate is not to be trusted. Also, some browsers might fail to initiate the secure WebSocket connection for the same reason. This example was tested on chromium and on chrome for android. To fix this in a real case you need a proper certificate (by using letsencrypt for example).

You can use the python script to serve the examples/ folder via HTTPS (remember to edit the HTML example file to use your IP address, otherwise it will only work for localhost):

$ cd examples/
$ python https_server.py

and on another terminal run spatify:

$ cd examples/
$ spatify --crt localhost.cert --key localhost.key
2020-12-12 15:25,509 Listening for websocket signaling on 0.0.0.0:8765

Now open https:///websockets.html and click on "Start connection".

You should see a new JACK client called spatify_* registered (if you use QJackCtl or Carla it should appear in the routing). Route any audio to this new client and it should play on the browser you used.

You might also like...
?️ Open Source Audio Matching and Mastering
?️ Open Source Audio Matching and Mastering

Matching + Mastering = ❤️ Matchering 2.0 is a novel Containerized Web Application and Python Library for audio matching and mastering. It follows a si

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications
Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications

A Python library for audio feature extraction, classification, segmentation and applications This doc contains general info. Click here for the comple

Manipulate audio with a simple and easy high level interface

Pydub Pydub lets you do stuff to audio in a way that isn't stupid. Stuff you might be looking for: Installing Pydub API Documentation Dependencies Pla

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications
Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications

A Python library for audio feature extraction, classification, segmentation and applications This doc contains general info. Click here for the comple

All-In-One Digital Audio Workstation and Plugin Suite

How to install Windows Mac OS X Fedora Ubuntu How to Build Debian and Ubuntu Fedora All Other Linux Distros Mac OS X Windows What is MusiKernel? MusiK

a library for audio and music analysis

aubio aubio is a library to label music and sounds. It listens to audio signals and attempts to detect events. For instance, when a drum is hit, at wh

Marsyas - Music Analysis, Retrieval and Synthesis for Audio Signals

Welcome to MARSYAS. MARSYAS is a software framework for rapid prototyping of audio applications, with flexibility and extensibility as primary concer

Python audio and music signal processing library

madmom Madmom is an audio signal processing library written in Python with a strong focus on music information retrieval (MIR) tasks. The library is i

FPGA based USB 2.0 high speed audio interface featuring multiple optical ADAT inputs and outputs

ADAT USB Audio Interface FPGA based USB 2.0 High Speed audio interface featuring multiple optical ADAT inputs and outputs Status / current limitations

Owner
Bruno Gola
sound, art and code
Bruno Gola
cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python

audioread Decode audio files using whichever backend is available. The library currently supports: Gstreamer via PyGObject. Core Audio on Mac OS X via

beetbox 419 Dec 26, 2022
cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python

audioread Decode audio files using whichever backend is available. The library currently supports: Gstreamer via PyGObject. Core Audio on Mac OS X via

beetbox 359 Feb 15, 2021
Audio augmentations library for PyTorch for audio in the time-domain

Audio augmentations library for PyTorch for audio in the time-domain, with support for stochastic data augmentations as used often in self-supervised / contrastive learning.

Janne 166 Jan 8, 2023
praudio provides audio preprocessing framework for Deep Learning audio applications

praudio provides objects and a script for performing complex preprocessing operations on entire audio datasets with one command.

Valerio Velardo 105 Dec 26, 2022
convert-to-opus-cli is a Python CLI program for converting audio files to opus audio format.

convert-to-opus-cli convert-to-opus-cli is a Python CLI program for converting audio files to opus audio format. Installation Must have installed ffmp

null 4 Dec 21, 2022
Python CD-DA ripper preferring accuracy over speed

Whipper Whipper is a Python 3 (3.6+) CD-DA ripper based on the morituri project (CDDA ripper for *nix systems aiming for accuracy over speed). It star

null 671 Jan 4, 2023
C++ library for audio and music analysis, description and synthesis, including Python bindings

Essentia Essentia is an open-source C++ library for audio analysis and audio-based music information retrieval released under the Affero GPL license.

Music Technology Group - Universitat Pompeu Fabra 2.3k Jan 3, 2023
An app made in Python using the PyTube and Tkinter libraries to download videos and MP3 audio.

yt-dl (GUI Edition) An app made in Python using the PyTube and Tkinter libraries to download videos and MP3 audio. How do I download this? Windows: Fi

null 1 Oct 23, 2021
Audio fingerprinting and recognition in Python

dejavu Audio fingerprinting and recognition algorithm implemented in Python, see the explanation here: How it works Dejavu can memorize audio by liste

Will Drevo 6k Jan 6, 2023
Python library for audio and music analysis

librosa A python package for music and audio analysis. Documentation See https://librosa.org/doc/ for a complete reference manual and introductory tut

librosa 5.6k Jan 6, 2023