Package ej.audio.oggvorbis
Class OggVorbisParser
- java.lang.Object
-
- ej.audio.oggvorbis.OggVorbisParser
-
public class OggVorbisParser extends Object
Parses the Ogg container header to extract Vorbis stream parameters.An Ogg Vorbis stream begins with an Ogg page whose first packet is the Vorbis identification header. This class reads just enough of that header to determine the sample rate and channel count without consuming the stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOggVorbisParser.OggVorbisParametersImmutable holder for Ogg Vorbis stream parameters extracted from the identification header.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OggVorbisParser.OggVorbisParametersgetFormatParameters(InputStream inputStream)Extracts audio format parameters from the Ogg Vorbis identification header of the given stream.
-
-
-
Method Detail
-
getFormatParameters
public static OggVorbisParser.OggVorbisParameters getFormatParameters(InputStream inputStream) throws AudioException, IOException
Extracts audio format parameters from the Ogg Vorbis identification header of the given stream.The stream position is restored to its original position after this call, so the same stream can be used for subsequent playback. The stream must support mark/reset.
- Parameters:
inputStream- the Ogg Vorbis input stream; must support mark/reset.- Returns:
- an
OggVorbisParser.OggVorbisParameterscontaining the sample rate and channel count. - Throws:
AudioException- if the stream is not a valid Ogg Vorbis stream or the format is not recognized.IOException- if the stream cannot be read.- Since:
- 3.0.0
-
-