org.thenesis.midpath.sound.codec
Class OggVorbisDecoder

java.lang.Object
  extended by org.thenesis.midpath.sound.codec.OggVorbisDecoder
All Implemented Interfaces:
AudioDecoder

public class OggVorbisDecoder
extends java.lang.Object
implements AudioDecoder

Takes a vorbis bitstream from an input stream and writes raw stereo PCM to an output stream. Decodes simple and chained OggVorbis files from beginning to end.


Field Summary
static int CLOSED
           
static int DECODING
           
static int PREPARED
           
static int STOPPED
           
 
Constructor Summary
OggVorbisDecoder()
           
 
Method Summary
 void close()
           
 int decodeStep(DecoderCallback callback)
          Decodes stream and write resulting PCM audio data to the given output stream.
 int getChannels()
           
 java.lang.String[] getComments()
           
 AudioFormat getOutputAudioFormat()
           
 int getSampleRate()
           
 java.lang.String[] getUserComments()
           
 java.lang.String getVendor()
           
 void initialize(java.io.InputStream is)
          Initialize decoder
 void pause()
           
 void resume()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STOPPED

public static final int STOPPED
See Also:
Constant Field Values

PREPARED

public static final int PREPARED
See Also:
Constant Field Values

DECODING

public static final int DECODING
See Also:
Constant Field Values

CLOSED

public static final int CLOSED
See Also:
Constant Field Values
Constructor Detail

OggVorbisDecoder

public OggVorbisDecoder()
Method Detail

initialize

public void initialize(java.io.InputStream is)
                throws java.io.IOException
Initialize decoder

Specified by:
initialize in interface AudioDecoder
Throws:
java.io.IOException
IllegalDecoderStateException

decodeStep

public int decodeStep(DecoderCallback callback)
               throws java.io.IOException
Decodes stream and write resulting PCM audio data to the given output stream.

Specified by:
decodeStep in interface AudioDecoder
Throws:
java.io.IOException
IllegalDecoderStateException

close

public void close()

pause

public void pause()

resume

public void resume()

getComments

public java.lang.String[] getComments()

getUserComments

public java.lang.String[] getUserComments()

getVendor

public java.lang.String getVendor()

getChannels

public int getChannels()

getSampleRate

public int getSampleRate()

getOutputAudioFormat

public AudioFormat getOutputAudioFormat()
Specified by:
getOutputAudioFormat in interface AudioDecoder