// Path: src/main/java/ddf/minim/spi/AudioOut.java
// @SuppressWarnings("deprecation")
// public interface AudioOut extends AudioResource
// {
// 	/**
// 	 * @return the size of the buffer used by this output.
// 	 */
// 	int bufferSize();
// 
// 	/**
// 	 * Sets the AudioSignal that this output will use to generate sound.
// 	 * 
// 	 * @param signal
// 	 *            the AudioSignal used to generate sound
// 	 */
// 	@Deprecated
// 	void setAudioSignal(AudioSignal signal);
// 
// 	/**
// 	 * Sets the AudioStream that this output will use to generate sound.
// 	 * 
// 	 * @param stream
// 	 */
// 	void setAudioStream(AudioStream stream);
// 
// 	/**
// 	 * Sets the AudioEffect to apply to the signal.
// 	 * 
// 	 * @param effect
// 	 *            the AudioEffect to apply to the signal
// 	 */
// 	@Deprecated
// 	void setAudioEffect(AudioEffect effect);
// 
// 	/**
// 	 * Sets the AudioListener that will have sound broadcasted to it as the
// 	 * output generates.
// 	 * 
// 	 * @param listen
// 	 */
// 	void setAudioListener(AudioListener listen);
// }
// 
// Path: src/main/java/ddf/minim/spi/AudioStream.java
// public interface AudioStream extends AudioResource
// {    
//   /**
//    * Reads the next sample frame.
//    * 
//    * @return an array of floats containing the value of each channel in the sample frame just read.
//    * 		 The size of the returned array will be the same size as getFormat().getChannels(). 
//    */
//   @Deprecated
//   float[] read();
//   
//   /**
//    * Reads buffer.getBufferSize() sample frames and puts them into buffer's channels.
//    * The provided buffer will be forced to have the same number of channels that this 
//    * AudioStream does.
//    * 
//    * @param buffer The MultiChannelBuffer to fill with audio samples.
//    * 
//    * @return int: the number of sample frames that were actually read, could be smaller than the size of the buffer.
//    */
//   int read(MultiChannelBuffer buffer);
// }


import ddf.minim.spi.AudioOut;
import ddf.minim.spi.AudioStream;
/*
 *  Copyright (c) 2007 - 2008 by Damien Di Fede <ddf@compartmental.net>
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Library General Public License as published
 *   by the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Library General Public License for more details.
 *
 *   You should have received a copy of the GNU Library General Public
 *   License along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

package ddf.minim;


/**
 * An AudioInput is a connection to the current record source of the computer. 
 * How the record source for a computer is set will depend on the soundcard and OS, 
 * but typically a user can open a control panel and set the source from there. 
 * Unfortunately, there is no way to set the record source from Java.
 * <p>
 * You can obtain an AudioInput from Minim by using one of the getLineIn methods:
 * <pre>
 * // get the default STEREO input
 * AudioInput getLineIn()
 * 
 * // specifiy either Minim.MONO or Minim.STEREO for type
 * AudioInput getLineIn(int type)
 * 
 * // bufferSize is the size of the left, right,
 * // and mix buffers of the input you get back
 * AudioInput getLineIn(int type, int bufferSize)
 * 
 * // sampleRate is a request for an input of a certain sample rate
 * AudioInput getLineIn(int type, int bufferSize, float sampleRate)
 * 
 * // bitDepth is a request for an input with a certain bit depth
 * AudioInput getLineIn(int type, int bufferSize, float sampleRate, int bitDepth)
 * </pre>
 * In the event that an input doesn't exist with the requested parameters, 
 * Minim will spit out an error and return null. In general, 
 * you will want to use the first two methods listed above.
 * 
 * @example Basics/MonitorInput
 * 
 * @related Minim
 * 
 * @author Damien Di Fede
 *
 */
public class AudioInput extends AudioSource
{  
  boolean 		m_isMonitoring; 
  AudioStream	m_stream;
  
  /** @invisible
   * 
   * Constructs an <code>AudioInput</code> that uses <code>out</code> to read 
   * samples from <code>stream</code>. The samples from <code>stream</code> 
   * can be accessed by through the interface provided by <code>AudioSource</code>.
   * 
   * @param stream the <code>AudioStream</code> that provides the samples
   * @param out the <code>AudioOut</code> that will read from <code>stream</code>
   */
// Path: src/main/java/ddf/minim/spi/AudioOut.java
// @SuppressWarnings("deprecation")
// public interface AudioOut extends AudioResource
// {
// 	/**
// 	 * @return the size of the buffer used by this output.
// 	 */
// 	int bufferSize();
// 
// 	/**
// 	 * Sets the AudioSignal that this output will use to generate sound.
// 	 * 
// 	 * @param signal
// 	 *            the AudioSignal used to generate sound
// 	 */
// 	@Deprecated
// 	void setAudioSignal(AudioSignal signal);
// 
// 	/**
// 	 * Sets the AudioStream that this output will use to generate sound.
// 	 * 
// 	 * @param stream
// 	 */
// 	void setAudioStream(AudioStream stream);
// 
// 	/**
// 	 * Sets the AudioEffect to apply to the signal.
// 	 * 
// 	 * @param effect
// 	 *            the AudioEffect to apply to the signal
// 	 */
// 	@Deprecated
// 	void setAudioEffect(AudioEffect effect);
// 
// 	/**
// 	 * Sets the AudioListener that will have sound broadcasted to it as the
// 	 * output generates.
// 	 * 
// 	 * @param listen
// 	 */
// 	void setAudioListener(AudioListener listen);
// }
// 
// Path: src/main/java/ddf/minim/spi/AudioStream.java
// public interface AudioStream extends AudioResource
// {    
//   /**
//    * Reads the next sample frame.
//    * 
//    * @return an array of floats containing the value of each channel in the sample frame just read.
//    * 		 The size of the returned array will be the same size as getFormat().getChannels(). 
//    */
//   @Deprecated
//   float[] read();
//   
//   /**
//    * Reads buffer.getBufferSize() sample frames and puts them into buffer's channels.
//    * The provided buffer will be forced to have the same number of channels that this 
//    * AudioStream does.
//    * 
//    * @param buffer The MultiChannelBuffer to fill with audio samples.
//    * 
//    * @return int: the number of sample frames that were actually read, could be smaller than the size of the buffer.
//    */
//   int read(MultiChannelBuffer buffer);
// }


// Path: src/main/java/ddf/minim/AudioInput.java
import ddf.minim.spi.AudioOut;
import ddf.minim.spi.AudioStream;

/*
 *  Copyright (c) 2007 - 2008 by Damien Di Fede <ddf@compartmental.net>
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Library General Public License as published
 *   by the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Library General Public License for more details.
 *
 *   You should have received a copy of the GNU Library General Public
 *   License along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

package ddf.minim;


/**
 * An AudioInput is a connection to the current record source of the computer. 
 * How the record source for a computer is set will depend on the soundcard and OS, 
 * but typically a user can open a control panel and set the source from there. 
 * Unfortunately, there is no way to set the record source from Java.
 * <p>
 * You can obtain an AudioInput from Minim by using one of the getLineIn methods:
 * <pre>
 * // get the default STEREO input
 * AudioInput getLineIn()
 * 
 * // specifiy either Minim.MONO or Minim.STEREO for type
 * AudioInput getLineIn(int type)
 * 
 * // bufferSize is the size of the left, right,
 * // and mix buffers of the input you get back
 * AudioInput getLineIn(int type, int bufferSize)
 * 
 * // sampleRate is a request for an input of a certain sample rate
 * AudioInput getLineIn(int type, int bufferSize, float sampleRate)
 * 
 * // bitDepth is a request for an input with a certain bit depth
 * AudioInput getLineIn(int type, int bufferSize, float sampleRate, int bitDepth)
 * </pre>
 * In the event that an input doesn't exist with the requested parameters, 
 * Minim will spit out an error and return null. In general, 
 * you will want to use the first two methods listed above.
 * 
 * @example Basics/MonitorInput
 * 
 * @related Minim
 * 
 * @author Damien Di Fede
 *
 */
public class AudioInput extends AudioSource
{  
  boolean 		m_isMonitoring; 
  AudioStream	m_stream;
  
  /** @invisible
   * 
   * Constructs an <code>AudioInput</code> that uses <code>out</code> to read 
   * samples from <code>stream</code>. The samples from <code>stream</code> 
   * can be accessed by through the interface provided by <code>AudioSource</code>.
   * 
   * @param stream the <code>AudioStream</code> that provides the samples
   * @param out the <code>AudioOut</code> that will read from <code>stream</code>
   */
  public AudioInput(AudioStream stream, AudioOut out)