A small Windows utility that reads the MasterVolume of the default capture device (microphone) and shows a GUI message box if it is below 100%. It runs without opening a console window.
- Windows 10/11 (x64)
- Go 1.24+
- An enabled default capture device (microphone)
github.com/moutend/go-wcagithub.com/go-ole/go-ole
They are already listed in go.mod. No manual go get is required.
- Using the batch script (GUI subsystem, no console window):
- Run
.\build_gui.batto producemiclevel.exe.
- Run
- Using the command directly:
go build -ldflags="-H=windowsgui" -o miclevel.exe .
- Double-click
miclevel.exein Explorer or start it as a process. - A warning message box is shown only if MasterVolume is below 100%.
- If MasterVolume is 100%, the app exits silently with no UI.
- Targets the default capture device with role
EMultimedia. - Reads the scalar volume (0.0–1.0) and treats values
< 1.0 - 0.001as "below 100%" (epsilon for floating-point). - Since it is built as a GUI subsystem binary,
fmt.Printfoutput is not visible. If you need logs, build without-H=windowsguior write to a file.
main_miclevel.go:- Initializes COM → gets default device → acquires
IAudioEndpointVolume→ reads volume → shows aMessageBoxWwhen needed.
- Initializes COM → gets default device → acquires
build_gui.bat:- Convenience script that runs
go build -ldflags="-H=windowsgui" -o miclevel.exe ..
- Convenience script that runs
- The message box text is currently English. You can localize it by editing the strings passed to
messageBox.