Server for wasm-synth to stream data in web-compatible format.
This year's chaos communication congress is hosted in the rc3
world. A RPG-inspired virtual environment called
workadventure. Users can build their own maps within
workadventure, and so SDP is building their own map
too. Within a map, audio
streams can be added using HTML tags like <audio>
.
As I've been eagerly hacking on wasm-synth since many congresses, I saw this as a chance to build a mobile stage, artists can perform on the wasm-synth.
WASM-STREAM is an attempt to plug an instrument into the internet. It's
simply a web-based synthesizer that renders Float32Array
s using the AudioWorklet
and WebAssembly and sends this data to a user's sound card. When I saw that
this year's congress is happening remote, I thought, why not stream the
sound it makes to everybody on the map. Like a concert.
- icecast2 server
- webcast server (this repository)
- Webcast integrated into WASM-SYNTH and sending mp3-encoded data
$ cp .env_copy .env
$ vim .env
$ npm i
$ npm run dev
When installing icecast, this
tutorial is
helpful. It automatically prompts the user to add some data. Additionally, it
creates a configuration file at /etc/icecast2/icecast.xml
. The following is
necessary to add into the config file:
<mount>
<username>user</username>
<password>pass</password>
<mount-name>/stream</mount-name>
<max-listeners>100000</max-listeners>
<public>1</public>
<fallback-mount>stream2.ogg</fallback-mount>
</mount>
That allows a user to connect at /stream
and broadcast to any listener.
We're using PM2 for deploying and managing the server in production.
An ecosystem.config.js
file is provided.