Download volumeControl.zip here

This package allows you to control the Windows 7's main volume and Matlab's volume, either from Matlab or from the command line. It was put together so that we could get control over presentation levels independently of Windows 7's (and its users') foibles.

Requirements: Windows 7 and .NET framework 4.0 or later (i.e., if you bought Windows 7 recently, you're probably fine, but if you were quick to switch to Windows 7, you may need to download and install a more recent .NET framework.)

Included are:

SetWindowsVolume.exe: This program by default sets the main Windows 7 volume to 100% and unmutes it if necessary. Alternatively, a different level can be set by passing a parameter between 0 and 1 (e.g., “SetWindowsVolume.exe 0.5” from the command line to set the volume to 50%).

tvolumecontrol.m: A matlab function that includes control over both Windows 7’s main volume (acting as an interface to SetWindowsVolume.exe) and Matlab’s own separate volume control in Windows. By default, it will set both volume controls to 100% and unmute them, but it also accepts parameters, e.g.,

>> tvolumecontrol(0.37,0.99); %sets Windows 7’s volume to 37% and Matlab’s to 99%

Download volumeControl.zip here


These programs build heavily (almost entirely) on two pre-existing programs, SoundVolume.m and Core Audio. Thanks to their authors for somehow taming Windows 7's volume controls and also to Dan Goodman, Cyrille Rossant, Stuart Rosen, and Daniel Pressnitzer.

If you’d like the C# code or have any other comments/questions, contact me at trevor.agus@ens.fr.