5.0

5.0 | 1 rating Rate this file 142 downloads (last 30 days) File Size: 2.53 KB File ID: #25584

SoundVolume - set or get the system speaker sound volume

by Yair Altman

 

15 Oct 2009 (Updated 15 Oct 2009)

Code covered by BSD License  

SoundVolume sets or gets the computer system's speaker sound volume, using Java

Download Now | Watch this File

File Information
Description

SoundVolume sets or gets the computer's system speaker sound volume
 
Syntax:
       volume = SoundVolume(volume);
 
SoundVolume(volume) sets the system speaker sound volume. The volume value should be numeric, between 0.0 (=muted) and 1.0 (=max).
 
volume = SoundVolume gets the current speaker sound volume (0.0-1.0).
 
volume = SoundVolume(volume) sets the system speaker sound volume and returns the previous volume value (from before setting the new value).
 
Note:
      SoundVolume relies on Java functionality that is fully supported and documented. In this respect, SoundVolume is different from some of my other Matlab-Java utilities that rely on undocumented code.
 
Bugs and suggestions:
      Please send to Yair Altman (altmany at gmail dot com)
 
See also:
      http://UndocumentedMatlab.com
      http://java.sun.com/docs/books/tutorial/sound

MATLAB release MATLAB 7.6 (R2008a)
Zip File Content  
Other Files license.txt,
SoundVolume.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
03 Nov 2009 D Nguyen

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!

Please login to add a comment or rating.
Updates
15 Oct 2009

Clarified that SoundVolume uses fully documented and supported Java functionality.

Tag Activity for this File
Tag Applied By Date/Time
java Yair Altman 15 Oct 2009 10:28:59
sound Yair Altman 15 Oct 2009 10:28:59
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com