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  

duration()

   
Examples  
PSound mySound; 
 
void setup() { 
  mySound = loadSound("arigato.wav"); 
  mySound.play(); 
  // Displays the length of the sound 
  // in the text area of the Processing 
  // environment 
  println(mySound.duration()); 
} 
 
void draw() 
{ 
  // The blank draw() is necessary to let the sound play 
} 

Description   Returns the length of the sound in seconds.
   
Syntax  
sound.duration()
   
Parameters  
sound   PSound: any variable of type PSound

   
Returns   Float
   
Usage   Web & Application
   
 
 






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








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