FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Back  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Class   PSound
   
Name  

volume()

   
Examples  
PSound mySound; 
 
void setup() { 
  mySound = loadSound("arigato.wav"); 
  mySound.loop(); 
} 
 
void draw() { 
  // Sets the volume to 0.0 (silent) when the 
  // mouse is on the left edge of the window 
  // and to 1.0 (maximum) when the mouse is on 
  // the right edge of the window. 
  mySound.volume(float(mouseX)/width); 
} 

Description   Sets the volume of the sound playback where setting the parameter to 1.0 is the sound's actual loudness with descending numbers decreasing the volume until the parameter reaches 0.0, which is the smallest valid value.
   
Syntax  
sound.volume(amp)
   
Parameters  
sound   PSound: any variable of type PSound

amp   float: value between 0.0 and 1.0

   
Usage   Web & Application
   
 
 






   
 
Updated: Fri Jul 15 16:36:02 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info