jass.generators
Class SpatialMixer

java.lang.Object
  extended by jass.engine.Out
      extended by jass.engine.InOut
          extended by jass.generators.SpatialMixer
All Implemented Interfaces:
Sink, Source

public class SpatialMixer
extends InOut

Spatial Mixer UG.

Author:
Reynald Hoskinson (reynald@cs.ubc.ca)

Field Summary
protected  HRTF hrtf
           
protected  PositionData[] positions
           
protected  float[] tmp_bufL
           
protected  float[] tmp_bufR
           
protected  float[] tmp_out
           
 
Fields inherited from class jass.engine.InOut
sourceContainer, sourcePassivity, srcBuffers
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
SpatialMixer(int bufferSize)
          Create.
SpatialMixer(int bufferSize, int n, java.lang.String hrtf_data)
          Create stereo Spatialized mixer
 
Method Summary
 void changeHRTF(java.io.File filename)
           
protected  void computeBuffer()
          Compute the next buffer and store in member float[] buf.
 void setPosition(int inputNo, PositionData p)
          set position of source
 void startHRTF()
          set filename to obtain hrir info for 1 subject
 void stopHRTF()
           
 
Methods inherited from class jass.engine.InOut
addSource, addSource, getBuffer, getSources, removeSource, resetTime
 
Methods inherited from class jass.engine.Out
clearBuffer, copyToOld, getBuffer, getBufferSize, getTime, peekAtBuffer, setBufferSize, setTime, setTimeAndNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tmp_bufL

protected float[] tmp_bufL

tmp_bufR

protected float[] tmp_bufR

tmp_out

protected float[] tmp_out

hrtf

protected HRTF hrtf

positions

protected PositionData[] positions
Constructor Detail

SpatialMixer

public SpatialMixer(int bufferSize,
                    int n,
                    java.lang.String hrtf_data)
Create stereo Spatialized mixer

Parameters:
bufferSize - Buffer size used for real-time rendering. For stereo must be 2X input buffersize
n - no inputs
hrtf_data - hrtf file.

SpatialMixer

public SpatialMixer(int bufferSize)
Create. For superclasses

Parameters:
bufferSize - Buffer size used for real-time rendering.
Method Detail

startHRTF

public void startHRTF()
set filename to obtain hrir info for 1 subject

Parameters:
filename - filename of subject's hrir data

stopHRTF

public void stopHRTF()

changeHRTF

public void changeHRTF(java.io.File filename)

setPosition

public void setPosition(int inputNo,
                        PositionData p)
set position of source

Parameters:
inputNo - buffer number to set position of
p - Position data gives the 3D coordinate of the sound source

computeBuffer

protected void computeBuffer()
Compute the next buffer and store in member float[] buf. Note if stereo then output buf[] is twice as big as input buffers --> this means that each source is a mono stream. will sourceContainer.size() always == n in Mixer constructor?

Specified by:
computeBuffer in class Out