@@ -9,8 +9,9 @@ import audioHandler
mqtt_host = "localhost"
mqtt_port = 1883
interval = 20.0 # sec
+use_audio_sink = False
-audio = audioHandler.Listener(dataTime=interval if interval<5 else 5, agcTime=interval, input=True)
+audio = audioHandler.Listener(dataTime=interval if interval<5 else 5, agcTime=interval, input=not use_audio_sink)
def main():
@@ -0,0 +1,15 @@
+# MQTT Audio Level Meter
+
+Publishes the volume of an audio source to a MQTT server.
+Test setup: Raspberry Pi with an USB microphone and a local Mosquitto server
+Can be configured to capture audio output or input under Linux and Windows.
+## Installation
+```bash
+python3 -m pip install paho.mqtt
+python3 -m pip install pyaudio
+python3 main.py
+```