Monitors attached microphone and provides sox
functionality as micro-service, transmitting WAV data and spectrogram visualization (PNG) a designated MQTT host. This container may be run locally using Docker, pushed to a Docker registry, and published to any Open Horizon exchange.
org
-[email protected]
url
-com.github.dcmartin.open-horizon.noize
version
-0.0.1
NOIZE_GROUP
- group name (aka top-level topic); defaults tonoize
NOIZE_CLIENT
- client name; defaults toHZN_DEVICE_ID
orhostname
NOIZE_DEVICE
- device to record sound; default: system default deviceNOIZE_START_LEVEL
- default:1
percentNOIZE_START_SECONDS
- default:0.1
secondsNOIZE_TRIM_DURATION
- default:5
secondsNOIZE_THRESHOLD_TUNE
- default:false
NOIZE_INCLUDE_WAV
- include audio as base64 encoded WAV; default:true
NOIZE_INCLUDE_PNG
- include spectrogram as base64 encoded PNG; default:true
NOIZE_THRESHOLD
- default:none
; specify KHzNOIZE_LEVEL_TUNE
- default:false
LOGTO
- specify place to log; default:"/dev/stderr"
; use""
for${TMPDIR}/${0##*/}.log
LOG_LEVEL
- specify level of logging; defaultinfo
; options include (debug
andnone
; currently ignored)DEBUG
- default:false
MQTT_PORT
- port number; defaults to1883
MQTT_USERNAME
- MQTT username; defaults to ""MQTT_PASSWORD
- MQTT password; defaults to ""
Copy this repository, change to the noize
directory, then use the make command; see below:
% mkdir ~/gitdir
% cd ~/gitdir
% git clone http://github.com/dcmartin/open-horizon
% cd open-horizon.noize
% make
...
The noize
value will initially be incomplete until the service completes its initial execution. Subsequent tests should return a completed payload, see below:
% make check
should result in a partial service payload:
{
"mqtt": null,
"noize": {
"date": 1555859075,
"client": "b95ffa22f971",
"mock": "square",
"noise": "<base64 encoded WAV>",
"spectrogram": "<base64 encoded PNG>"
},
"date": 1555859040,
"hzn": {
"agreementid": "",
"arch": "",
"cpus": 0,
"device_id": "",
"exchange_url": "",
"host_ips": [
""
],
"organization": "",
"ram": 0,
"pattern": null
},
"config": {
"tmpdir": "/tmpfs",
"logto": "/dev/stderr",
"log_level": "info",
"debug": true,
"group": "noize",
"client": "b95ffa22f971",
"start": {
"level": 1,
"seconds": 0.1
},
"trim": {
"duration": 5
},
"sample_rate": "19200",
"threshold": "none",
"threshold_tune": false,
"level_tune": false,
"services": [
{
"name": "mqtt",
"url": "http://mqtt"
}
]
},
"service": {
"label": "noize",
"version": "0.0.1"
}
}
EXAMPLE
Releases are based on Semantic Versioning, and use the format
of MAJOR.MINOR.PATCH
. In a nutshell, the version will be incremented
based on the following:
MAJOR
: Incompatible or major changes.MINOR
: Backwards-compatible new features and enhancements.PATCH
: Backwards-compatible bugfixes and package updates.