com.icdif.audio.io
Class AudioDevice

java.lang.Object
  extended by com.icdif.audio.io.AudioDevice

public class AudioDevice
extends java.lang.Object

A class that allows the passage of PCM float data to the audio device

Author:
wanderer

Constructor Summary
AudioDevice(float sampleRate)
          Initializes the audio system
 
Method Summary
 void pausePlaying()
          By using the stop method of the Line, it can pause the playing (it can be resumed later)
 void playSamples(float[] samples)
          Passes the samples to the soundcard that plays them.
 void resumePlaying()
          By using the start method of the line, it can resume playing
 void stopPlaying()
          Stops playing, flushes and closes the line
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioDevice

public AudioDevice(float sampleRate)
            throws javax.sound.sampled.LineUnavailableException
Initializes the audio system

Throws:
javax.sound.sampled.LineUnavailableException - when the audio is not available
Method Detail

playSamples

public void playSamples(float[] samples)
Passes the samples to the soundcard that plays them. (Old times )Note: The samples have to be sampled at 44100Hz, mono and have to be in the range [-1,1].

Parameters:
samples - The Samples to play

pausePlaying

public void pausePlaying()
By using the stop method of the Line, it can pause the playing (it can be resumed later)


resumePlaying

public void resumePlaying()
By using the start method of the line, it can resume playing


stopPlaying

public void stopPlaying()
Stops playing, flushes and closes the line