WinBatch Technical Support Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Current version: 2022C (6.22CVC)
Home
Help
Search
Tech Database
Documentation
Downloads
Hints
Login
Register
WinBatch Technical Support Forum
»
All Things WinBatch
»
WinBatch
»
Detect audio output
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Detect audio output (Read 300 times)
cssyphus
Jr. Member
Posts: 74
Let's go Brandon
Detect audio output
«
on:
December 05, 2021, 12:30:17 pm »
Not an urgent need, but it would be nice to add this into a small app I use...
Is it poss to detect if there is any audio output currently happening on the system? All I need is a boolean Yes/No...
Windows has the "Volume Mixer" (with multiple ways to open it*) that displays a real-time volume meter... is there any way to tap into that (or any other Windows service that could be used) just to see if audio is currently playing on the system?
Any thoughts/ideas where to look? I've searched this tech support forum and the KnowledgeDB, but didn't find anything. Maybe someone has an idea how this might be done?
* Right-clicking on the speaker icon in the SysTray, also can be launched from command line [ C:\Windows\System32\SndVol.exe ]
Logged
Is this a pandemic... or an IQ test? newz.icu
td
Tech Support
Posts: 4064
Re: Detect audio output
«
Reply #1 on:
December 05, 2021, 03:15:41 pm »
Not sure that there is a method that doesn't involve some low level programming. Perhaps try a Web search using your search engine of choice.
Logged
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
- Dr. Tom Cade
td
Tech Support
Posts: 4064
Re: Detect audio output
«
Reply #2 on:
December 06, 2021, 08:07:57 am »
The WIL PlayMedia function does support querying specific device types' status. However, you would need to know the type of sound device you are targeting and not all devices support status commands. It would be more or less a trial and error process that may lead to frustration without satisfaction.
Logged
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
- Dr. Tom Cade
cssyphus
Jr. Member
Posts: 74
Let's go Brandon
Re: Detect audio output
«
Reply #3 on:
December 06, 2021, 09:23:12 am »
Ah haaa... something to try. Thanks very much, Tony. I appreciate the info, and the feedback / expectation-management also. I'll give this a try, understanding that it may or may not work, and will advise my findings.
Logged
Is this a pandemic... or an IQ test? newz.icu
cssyphus
Jr. Member
Posts: 74
Let's go Brandon
Re: Detect audio output
«
Reply #4 on:
December 18, 2021, 11:23:06 am »
For future curious, Rob Latour of Ottawa Canada indulged a recent request to modify his freeware app, SetVol, to report on the presence/absence of sound within a (user-provided) sampling period. If sound is discovered it reports back immediately, otherwise it waits out the sampling-period (default 5sec) before reporting "Sound not detected".
Example:
Code:
[Select]
setvol listen 0.5 > issound.txt
SetVol's original raison-d'etre was to allow command-line control over audio output. I've been using it with WinBatch for years, works great.
Ye can finde it here:
https://www.rlatour.com/setvol/
Logged
Is this a pandemic... or an IQ test? newz.icu
Print
Pages: [
1
]
Go Up
« previous
next »
WinBatch Technical Support Forum
»
All Things WinBatch
»
WinBatch
»
Detect audio output