Recorder for the Dobra Noc project.
Firstly, make sure you have Elixir installed and that the following native dependencies are available in your system:
- Portaudio 19.6.0
- FLAC 1.3.2
If not, install them with
apt-get update
apt-get -y install portaudio19-dev
apt-get -y install libflac-dev
Then fetch elixir dependencies
mix deps.get
Once installed, project can be run by typing mix start
. The following system variables are supported:
DOBRANOC_IP
- by default127.0.0.1
DOBRANOC_PORT
- by default8123
To save recording from given period, make a POST request to /save_rec
, with a JSON containing the following fields:
- from - unix timestamp (integer), beginning of recording
- to - unix timestamp (integer), end of recording
- location - path where to save recording (string); ".flac" extension will be appended
Example:
curl -H "Content-Type: application/json" \
-d '{"from":'$(($(date +%s) - 10))', "to":'$(($(date +%s) - 5))', "location":"out/out"}' \
-X POST http://localhost:8123/save_rec