Rob van der Woude's Scripting Pages

Help text for DetectSound.cs

(view help text of DetectSound.cs as plain text)

DetectSound.exe,  Version 2.00
Detect sound input on default microphone before detection period expires

Usage:  DetectSound.exe  [ threshold ]  [ timeout ]  [ /A | /X ]  [ /D ]  [ /Q ]

Where:  threshold   the minimum peak level to detect (1..99; default 50)
        timeout     detection period in milliseconds (100 or up; default: 1000)
        /A          Average peak value is returned as errorlevel
        /D          Debug mode: display value for each sample
        /Q          Quiet mode: no messages, only errorlevel to check result
        /X          eXit immediately if threshold is exceeded before timeout
                    expires (default: wait till timeout expires)

Notes:  This program uses Mark Heath's NAudio, available at
        https://github.com/naudio/NAudio to detect sound.
        Return code 1 or average peak level if sound is detected within the
        timeout period, 0 if not, or -1 in case of errors.

Written by Rob van der Woude
https://www.robvanderwoude.com

page last uploaded: 2025-10-23; loaded in 0.0049 seconds