Commit 57113eb6 authored by Anton Sarukhanov's avatar Anton Sarukhanov

Add references to Zabbix post

parent 3edd8fe4
......@@ -21,7 +21,7 @@ I already use it to keep an eye on my servers. Maybe it can help here?
# Measuring volume
We can use the [`rec` tool](https://linux.die.net/man/1/rec) (part of the [SoX](http://sox.sourceforge.net/) audio processor) to grab audio from the microphone and analyze it.
We can use the [`rec` tool](https://linux.die.net/man/1/rec) (part of the [SoX](http://sox.sourceforge.net/) audio processor) to grab audio from the microphone and analyze it[^0].
```bash
rec -n stat trim 0 .5
......@@ -127,7 +127,10 @@ WantedBy=multi-user.target
This takes care of a few things:
1. Waits until a network is available.
2. Sets the `AUDIODEV` and `AUDIODRIVER` environment variables required by `rec`.
2. Sets the `AUDIODEV` and `AUDIODRIVER` environment variables[^1].
3. Runs the script at `/usr/local/bin/zs.sh` (which contains the loop we wrote).
Enable the new service with `systemctl enable zs.service`, and start it with `service zs start`. It will automatically start on reboot.
[^0]: Thanks to StackExchange user "nandhp" for this clue. Source: [audio - Monitoring the microphone level with a command line tool in Linux - Super User](https://superuser.com/questions/306701/monitoring-the-microphone-level-with-a-command-line-tool-in-linux/306765#comment513094_306765)
[^1]: Apparently required by `rec`. Suitable values for a Raspberry Pi were suggested in this forum thread: [sox default device - Raspberry Pi Forums](https://www.raspberrypi.org/forums/viewtopic.php?p=342882&sid=66f9472be6de63a3b99718595bc8ddf5#p342882)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment