changeset 52:d799a0278cc9

advanced documentation.
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Dec 2011 13:51:28 -0600
parents 6a1b28f060e6
children 3dc1f15e1e13
files src/com/aurellem/capture/audio/CompositeSoundProcessor.java src/com/aurellem/capture/audio/WaveFileWriter.java src/com/aurellem/capture/examples/Advanced.java
diffstat 3 files changed, 31 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/src/com/aurellem/capture/audio/CompositeSoundProcessor.java	Sat Dec 03 13:42:30 2011 -0600
     1.2 +++ b/src/com/aurellem/capture/audio/CompositeSoundProcessor.java	Sat Dec 03 13:51:28 2011 -0600
     1.3 @@ -10,7 +10,6 @@
     1.4   * in which it was constructed.
     1.5   * 
     1.6   * @author Robert McIntyre
     1.7 - *
     1.8   */
     1.9  public class CompositeSoundProcessor implements SoundProcessor{
    1.10  
     2.1 --- a/src/com/aurellem/capture/audio/WaveFileWriter.java	Sat Dec 03 13:42:30 2011 -0600
     2.2 +++ b/src/com/aurellem/capture/audio/WaveFileWriter.java	Sat Dec 03 13:51:28 2011 -0600
     2.3 @@ -13,6 +13,12 @@
     2.4  import org.tritonus.share.sampled.file.TDataOutputStream;
     2.5  import org.tritonus.share.sampled.file.TNonSeekableDataOutputStream;
     2.6  
     2.7 +/** 
     2.8 + * A SoundProcessor that sends all sound data it receives to a wav file.
     2.9 + * 
    2.10 + * @author Robert McIntyre
    2.11 + */
    2.12 +
    2.13  public class WaveFileWriter implements SoundProcessor {
    2.14  
    2.15  	public File targetFile;
     3.1 --- a/src/com/aurellem/capture/examples/Advanced.java	Sat Dec 03 13:42:30 2011 -0600
     3.2 +++ b/src/com/aurellem/capture/examples/Advanced.java	Sat Dec 03 13:51:28 2011 -0600
     3.3 @@ -51,18 +51,27 @@
     3.4   * that can each hear the world from their own perspective.  
     3.5   * 
     3.6   * @author Robert McIntyre
     3.7 - *
     3.8   */
     3.9  
    3.10  public class Advanced extends SimpleApplication {
    3.11  
    3.12 -	private Geometry bell;
    3.13 -	private Geometry ear1;
    3.14 -	private Geometry ear2;
    3.15 -	private Geometry ear3;
    3.16 -	private AudioNode music;
    3.17 -	private MotionTrack motionControl;
    3.18 -		
    3.19 +	/**
    3.20 +	 * You will see three grey cubes, a blue sphere, and a path
    3.21 +	 * which circles each cube.  The blue sphere is generating a
    3.22 +	 * constant monotone sound as it moves along the track.  Each
    3.23 +	 * cube is listening for sound; when a cube hears sound whose
    3.24 +	 * intensity is greater than a certain threshold, it changes
    3.25 +	 * its color from grey to green.
    3.26 +	 * 
    3.27 +	 *  Each cube is also saving whatever it hears to a file.  The
    3.28 +	 *  scene from the perspective of the viewer is also saved to
    3.29 +	 *  a video file.  When you listen to each of the sound files
    3.30 +	 *  alongside the video, the sound will get louder when the
    3.31 +	 *  sphere approaches the cube that generated that sound file.
    3.32 +	 *  This shows that each listener is hearing the world from
    3.33 +	 *  its own perspective.
    3.34 +	 * 
    3.35 +	 */
    3.36  	public static void main(String[] args) {
    3.37  		Advanced app = new Advanced();
    3.38  		AppSettings settings = new AppSettings(true);
    3.39 @@ -81,6 +90,14 @@
    3.40  		app.start();
    3.41  	}
    3.42  
    3.43 +	
    3.44 +	private Geometry bell;
    3.45 +	private Geometry ear1;
    3.46 +	private Geometry ear2;
    3.47 +	private Geometry ear3;
    3.48 +	private AudioNode music;
    3.49 +	private MotionTrack motionControl;
    3.50 +		
    3.51  	private Geometry makeEar(Node root, Vector3f position){
    3.52  		Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    3.53  		Geometry ear = new Geometry("ear", new Box(1.0f, 1.0f, 1.0f));