jass.generators
Class AudioIn

java.lang.Object
  extended by jass.engine.Out
      extended by jass.generators.AudioIn
All Implemented Interfaces:
Source

public class AudioIn
extends Out

Obtain buffers by reading audio input. To use native audio input use appropriate contructor. Mono input only.

Author:
Kees van den Doel (kvdoel@cs.ubc.ca) (ASIO interface by Richard Corbett.)

Field Summary
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
AudioIn(float srate, int bufferSize, int bufferSizeJavaSound)
          Constructor.
AudioIn(float srate, int bufferSize, int numRtAudioBuffers, SourcePlayer sp)
          Constructor uses RtAudioFullduplex.
AudioIn(float srate, int bufferSize, int bufferSizeJavaSound, java.lang.String preferredMixer, java.lang.String nativesource, int numRtAudioBuffers)
          Constructor.
 
Method Summary
 void close()
          Close resources If ASIO mode is running, the closing will be taken care of automatically.
protected  void computeBuffer()
          Method for reading data into buf
 void takeASIOData(short[] myData)
          This is where we will take the data from ASIO.
 
Methods inherited from class jass.engine.Out
clearBuffer, copyToOld, getBuffer, getBuffer, getBufferSize, getTime, peekAtBuffer, resetTime, setBufferSize, setTime, setTimeAndNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioIn

public AudioIn(float srate,
               int bufferSize,
               int bufferSizeJavaSound)
Constructor. Default mixer, uses JavaSound API

Parameters:
srate - Sampling rate in Hertz.
bufferSize - Buffer size of Out object.
bufferSizeJavaSound - Buffer size used by JavaSound. Set to 0 to get default.

AudioIn

public AudioIn(float srate,
               int bufferSize,
               int bufferSizeJavaSound,
               java.lang.String preferredMixer,
               java.lang.String nativesource,
               int numRtAudioBuffers)
Constructor. Allows selection of audio API, JavaSound mixer. Has all the options except RtAudioFullduplex

Parameters:
srate - Sampling rate in Hertz.
bufferSize - Buffer size of Out object.
bufferSizeJavaSound - Buffer size used by JavaSound. Set to 0 to get default. Not used if using native input.
preferredMixer - mixer name for JavaSound, for example "Esd Mixer". Use anything to get default. Ignoted if using native input
nativesource - "RtAudio""or "ASIO" or anything else to use JavaSound
numRtAudioBuffers - latency parameter for rtaudio 0 is lowest latency, ignored for JavaSound or ASIO

AudioIn

public AudioIn(float srate,
               int bufferSize,
               int numRtAudioBuffers,
               SourcePlayer sp)
Constructor uses RtAudioFullduplex. This means a single RtAudio native device is used for in and out. To use first create SourcePlayer object with RtAudioFullDuplex option. This will create inside SourcePlayer a RTFullDuplexRtAudio object which manages input and output.

Parameters:
srate - Sampling rate in Hertz.
bufferSize - Buffer size of Out object.
numRtAudioBuffers - latency parameter for rtaudio 0 is lowest latency, ignored for JavaSound or ASIO
Method Detail

takeASIOData

public void takeASIOData(short[] myData)
This is where we will take the data from ASIO. This function should not be explicitly called by the user. ASIO is calling this function.


computeBuffer

protected void computeBuffer()
Method for reading data into buf

Specified by:
computeBuffer in class Out

close

public void close()
Close resources If ASIO mode is running, the closing will be taken care of automatically.