Read the statement by Michael Teeuw here.
Execute script (GPIO Relay) based on if sound is being played
-
Hi guys, I want to monitor if audio is being played, e.g:
cat /proc/asound/card*/pcm*/sub*/statusAnd if any status contains
runningI want to execute a script (in my case turn on the amplifier). I want a simple solution and initially I thought it might be possible with udev or python or bash. Does any of you have a great and easy idea?Thanks
-
while sleep 1; do if grep -q 'RUNNING' '/proc/asound/card0/pcm0p/sub0/status'; then echo "Running!" else echo "Not Running!" fi donethis seems to work but the amplifier produces a too loud cracking sound when switching on, I have two spare relais und my MagicMirror, I will hook up the speakers to those and try again.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login