IBM Toolkit
for MPEG-4

player
Class PlayerAudioStreamMonitor

java.lang.Object
  extended byjava.io.InputStream
      extended byplayer.PlayerAudioStreamMonitor
All Implemented Interfaces:
PlayerStreamMonitor

public abstract class PlayerAudioStreamMonitor
extends java.io.InputStream
implements PlayerStreamMonitor

MPEG-4 Player Audio Stream Monitor. Allows an audio stream to be monitored info about the audio stream retrieved. Audio stream sample data is read using the InputStream methods and the sample data bytes are organised as they would be in WAV file. The InputStream can be close()d to end the monitoring for the stream and no further audio samples will be captured.


Constructor Summary
PlayerAudioStreamMonitor()
           
 
Method Summary
abstract  int getBitsPerSample()
          Gets the number of bits per audio stream sample.
abstract  int getNumBytesDropped()
          If the InputStream is not read fast enough the internal buffer can fill-up with audio samples and once full any ongoing audio samples will not be written in order to avoid blocking the audio playback.
abstract  int getNumChannels()
          Gets the number of channels in the audio stream.
abstract  int getSampleRate()
          Gets the audio stream sample rate, eg 44100, 22050 etc.
abstract  byte[] getWaveHeader()
          A convenience method to return a WAV header that can be used in conjunction with the audio samples.
abstract  byte[] getWaveHeader(int count)
          A convenience method to return a WAV header that can be used in conjunction with the audio samples.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface player.PlayerStreamMonitor
getESId, getODId
 

Constructor Detail

PlayerAudioStreamMonitor

public PlayerAudioStreamMonitor()
Method Detail

getSampleRate

public abstract int getSampleRate()
Gets the audio stream sample rate, eg 44100, 22050 etc.

Returns:
Sample rate

getBitsPerSample

public abstract int getBitsPerSample()
Gets the number of bits per audio stream sample. Currently will return either 8 or 16.

Returns:
Number of bits per sample

getNumChannels

public abstract int getNumChannels()
Gets the number of channels in the audio stream. Currently will return either 1 (mono) or 2 (stereo).

Returns:
Number of channels in the audio stream

getWaveHeader

public abstract byte[] getWaveHeader()
A convenience method to return a WAV header that can be used in conjunction with the audio samples. This will return a wave header with the data chunk length set to the number of bytes read at the time this method is called.

Returns:
A wave header

getWaveHeader

public abstract byte[] getWaveHeader(int count)
A convenience method to return a WAV header that can be used in conjunction with the audio samples. This will return a wave header with the data chunk length set to the count of bytes as passed. This may be used to have a header whose length indicator differs from the number of bytes read, for example if not all bytes read were actually used for some reason.

Parameters:
count - The number of bytes that should be indicated in the header
Returns:
A wav header

getNumBytesDropped

public abstract int getNumBytesDropped()
If the InputStream is not read fast enough the internal buffer can fill-up with audio samples and once full any ongoing audio samples will not be written in order to avoid blocking the audio playback.

Returns:
Number of bytes dropped

IBM Toolkit
for MPEG-4

© Copyright IBM Corp. 1998, 2006. All Rights Reserved.