Skip to content

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.

Notifications You must be signed in to change notification settings

basyura/go-miclevel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-miclevel

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.

Requirements

  • Windows 10/11 (x64)
  • Go 1.24+
  • An enabled default capture device (microphone)

Dependencies

  • github.com/moutend/go-wca
  • github.com/go-ole/go-ole

They are already listed in go.mod. No manual go get is required.

Build

  • Using the batch script (GUI subsystem, no console window):
    • Run .\build_gui.bat to produce miclevel.exe.
  • Using the command directly:
    • go build -ldflags="-H=windowsgui" -o miclevel.exe .

Run

  • Double-click miclevel.exe in 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.

Behavior

  • Targets the default capture device with role EMultimedia.
  • Reads the scalar volume (0.0–1.0) and treats values < 1.0 - 0.001 as "below 100%" (epsilon for floating-point).
  • Since it is built as a GUI subsystem binary, fmt.Printf output is not visible. If you need logs, build without -H=windowsgui or write to a file.

Files

  • main_miclevel.go:
    • Initializes COM → gets default device → acquires IAudioEndpointVolume → reads volume → shows a MessageBoxW when needed.
  • build_gui.bat:
    • Convenience script that runs go build -ldflags="-H=windowsgui" -o miclevel.exe ..

Notes

  • The message box text is currently English. You can localize it by editing the strings passed to messageBox.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published