audio
Interface AudioInterface

All Known Implementing Classes:
AbstractCODEC, AudioCodecAlaw, AudioCodecUlaw, AudioInterfacePCM

public interface AudioInterface

The abstract audio interface.

Author:
Mikica B Kocic

Nested Class Summary
static interface AudioInterface.Packetizer
          Audio sender interface used by instance of the AudioInterface class to send captured audio samples to the remote peer.
 
Method Summary
 void cleanUp()
          Cleans up resources used by the interface.
 AudioInterface getByFormat(java.lang.Integer format)
          Creates new instance of the interface by choosing specified CODEC format
 int getSampleSize()
          Returns the minimum sample size for use in creating buffers etc.
 int getVoicePduSubclass()
          Gets the VoicePDU subclass attribute of the AbstractAudio object
 long readWithTimestamp(byte[] buff)
          Reads from the microphone, using the buffer provided, but only filling getSampSize() bytes.
 void setAudioSender(AudioInterface.Packetizer as)
          Sets the audioSender attribute of the AbstractAudio object
 void startPlay()
          Starts the player
 long startRecording()
          Starts the recorder (returning the time-stamp)
 void startRinging()
          Starts ringing signal
 void stopPlay()
          Stops the player
 void stopRecording()
          Stops the recorder - but don't throw it away.
 void stopRinging()
          Stops ringing signal
 void writeBuffered(byte[] buff, long timestamp)
          Plays the sample given (AudioInterface.getSampleSize() bytes) assuming that it's timestamp is long
 void writeDirectly(byte[] buff)
          Writes directly to source line without buffering
 

Method Detail

getSampleSize

int getSampleSize()
Returns the minimum sample size for use in creating buffers etc.


readWithTimestamp

long readWithTimestamp(byte[] buff)
                       throws java.io.IOException
Reads from the microphone, using the buffer provided, but only filling getSampSize() bytes. Returns the time-stamp of the sample from the audio clock.

Throws:
java.io.IOException

stopRecording

void stopRecording()
Stops the recorder - but don't throw it away.


startRecording

long startRecording()
Starts the recorder (returning the time-stamp)


startPlay

void startPlay()
Starts the player


stopPlay

void stopPlay()
Stops the player


startRinging

void startRinging()
Starts ringing signal


stopRinging

void stopRinging()
Stops ringing signal


writeBuffered

void writeBuffered(byte[] buff,
                   long timestamp)
                   throws java.io.IOException
Plays the sample given (AudioInterface.getSampleSize() bytes) assuming that it's timestamp is long

Throws:
java.io.IOException

writeDirectly

void writeDirectly(byte[] buff)
                   throws java.io.IOException
Writes directly to source line without buffering

Throws:
java.io.IOException

getVoicePduSubclass

int getVoicePduSubclass()
Gets the VoicePDU subclass attribute of the AbstractAudio object


setAudioSender

void setAudioSender(AudioInterface.Packetizer as)
Sets the audioSender attribute of the AbstractAudio object


cleanUp

void cleanUp()
Cleans up resources used by the interface.


getByFormat

AudioInterface getByFormat(java.lang.Integer format)
Creates new instance of the interface by choosing specified CODEC format