<div dir="ltr"><div dir="ltr">On Sat, 7 Jan 2023 at 13:29, damion.yates--- via GLLUG <<a href="mailto:gllug@mailman.lug.org.uk">gllug@mailman.lug.org.uk</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 26 Sep 2022, Dr. Axel Stammler via GLLUG wrote:<br>
<br>
> I would like to remind myself of external amplifiers uselessly running so I <br>
> would like to play a short sound signal once in a while if there is no audio <br>
> playing. OTOH, the signal should obviously not be played over the built-in <br>
> speakers. So, how can I find out (preferably using a command-line utility in <br>
> a script) which of the ‘audio out’ connectors are actually connected to <br>
> anything (or just have a plug in them) and if anything is played over these <br>
> connections?<br>
<br>
I'm not sure if it's possible to programmatically determine external vs built <br>
in, but if you're not opposed to simply hard wiring this in a cron job you set <br>
up yourself, then you can just look up up the devices with `pactl info` you'll <br>
need to has this through some perl or something and then grep out the local <br>
device leaving you with the various attached external audio devices before <br>
using something like aplay just send audio.</blockquote><div><br></div><div>Erg, that'll teach me to use voice input on my phone. You'll need to "parse" or "pass"</div><div>this through a perl/sed/etc script (not "has this through some perl").</div><div><br></div><div>It seems to be `pw-cli ls` on systems that have moved to pipewire</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This assumes ALSA and pulseaudio <br>
which is reasonably likely but audio in Linux changed over many years so you <br>
might have Oss or you might be using pipewire etc etc. Determining if audio is <br>
currently playing will also be interesting as these new technologies simply <br>
attempt to mix audio together rather than block when you're device is in use.</blockquote><div><br></div><div>"your" - wtf voice input, can't you read the context?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
You might be able to kludge up some sort of grep against a console based volume <br>
bar indicator.<br></blockquote><div> </div><div>I found an example: <a href="https://pypi.org/project/soundmeter/">https://pypi.org/project/soundmeter/</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
This sounds like a fun little project to attempt using a bunch of Unix command <br>
line tools :)<br></blockquote><div><br></div><div><br></div><div>Also to the rest of you, Happy New year. It seems the list is working, the previous post </div><div>was from October but clearly nothing was wrong!</div><div><br></div><div> - Damion (this time from a laptop)<br></div><div><br></div></div></div>