org.xnap.plugin.viewer.vorbisviewer
Class VorbisInfo

java.lang.Object
  extended by org.xnap.plugin.viewer.vorbisviewer.VorbisInfo

public class VorbisInfo
extends java.lang.Object

A utility for reading information and comments from the header packets of an Ogg Vorbis stream.

Copyright (C) 2001 Matthew Elder

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

Version:
0.1
Author:
Matthew M. Elder

Constructor Summary
VorbisInfo(java.io.InputStream s)
          Initializes Ogg Vorbis information based on the header from a stream.
 
Method Summary
 long getBitrate()
          Returns the average bitrate of the stream in kbps.
 int getChannels()
          Returns the number of channels in the bitstream.
 java.util.Vector getComments(java.lang.String field)
          Returns a Vector containing values from the comment header.
 java.util.Set getFields()
          Returns a Set of comment field names in no particular order.
 long getRate()
          Returns the rate of the stream in Hz.
 java.lang.String toString()
          Prints out the information from an Ogg Vorbis stream in a nice, humanly-readable format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VorbisInfo

public VorbisInfo(java.io.InputStream s)
           throws java.io.IOException
Initializes Ogg Vorbis information based on the header from a stream.

Parameters:
s - an Ogg Vorbis data stream
Throws:
java.io.IOException
Method Detail

getChannels

public int getChannels()
Returns the number of channels in the bitstream.

Returns:
the number of channels in the bitstream.

getRate

public long getRate()
Returns the rate of the stream in Hz.

Returns:
the rate of the stream in Hz.

getBitrate

public long getBitrate()
Returns the average bitrate of the stream in kbps.

Returns:
the average bitrate of the stream in kbps.

getComments

public java.util.Vector getComments(java.lang.String field)
Returns a Vector containing values from the comment header. Vorbis comments take the form:
FIELD=SOME STRING VALUE.
Since there is no requirement for FIELD to be unique there may be multiple values for one field. getComments returns a Vector of String for all of the strings associated with a field.
Note: field is case insensitive.

Parameters:
field - a case insensitive string for a field name in an Ogg Vorbis comment header
Returns:
a Vector of strings containing field values from an Ogg Vorbis comment header

getFields

public java.util.Set getFields()
Returns a Set of comment field names in no particular order.

Returns:
a Set of comment field names in no particular order.

toString

public java.lang.String toString()
Prints out the information from an Ogg Vorbis stream in a nice, humanly-readable format.

Overrides:
toString in class java.lang.Object


Copyright © 2001-2005 XNap Team. All Rights Reserved.