I used this to integrate it with a GUI slider to control the system volume. Worked great! Had to slightly modify te code..
ctrls(ctrlIdx).getType to ctrls(ctrlIdx).getType.toString..with Yair Altman's help to get it to work on my system. Windows XP with MATLAB 7.0.4.365(R14) SP2, but otherwise works fine!