public class VorbisInfo extends Object
Modifier and Type | Field and Description |
---|---|
private long |
bitrate_lower
Description of the Field
|
private long |
bitrate_nominal
Description of the Field
|
private long |
bitrate_upper
Description of the Field
|
private int |
channels
Info Header channels.
|
(package private) Hashtable |
comment
The comments name value pairs in a Hashtable.
|
(package private) int |
comments
The number of comments.
|
private long[] |
crc_lookup
for doing checksum.
|
private int |
crc_ready
Description of the Field
|
private byte[] |
header
Description of the Field
|
private byte[] |
packet
Description of the Field
|
private long |
rate
Info Header bit rate.
|
(package private) String |
vendor
Description of the Field
|
Constructor and Description |
---|
VorbisInfo(InputStream s)
Initializes Ogg Vorbis information based on the header from a stream.
|
Modifier and Type | Method and Description |
---|---|
private long |
_ogg_crc_entry(long index)
Description of the Method
|
private byte[] |
checksum()
Description of the Method
|
private void |
fetch_comment_info()
Description of the Method
|
private void |
fetch_header_and_packet(InputStream s)
Description of the Method
|
private void |
fetch_info_info()
pull the fields from the info header
|
long |
getBitrate()
Returns the average bitrate of the stream in kbps.
|
int |
getChannels()
Returns the number of channels in the bitstream.
|
Vector |
getComments(String field)
Returns a
Vector containing values from the comment header. |
Set |
getFields()
Returns a
Set of comment field names in no particular order. |
long |
getRate()
Returns the rate of the stream in Hz.
|
private void |
interpret_header_packet()
Description of the Method
|
static void |
main(String[] args)
The main program for the VorbisInfo class
|
private int |
read32(byte[] data,
int ptr)
Description of the Method
|
String |
toString()
Prints out the information from an Ogg Vorbis stream in a nice,
humanly-readable format.
|
private int |
touint(byte n)
Description of the Method
|
private long |
toulong(int n)
Description of the Method
|
int comments
private int channels
private long rate
private long bitrate_upper
private long bitrate_nominal
private long bitrate_lower
private long[] crc_lookup
private int crc_ready
private byte[] header
private byte[] packet
public VorbisInfo(InputStream s) throws IOException
s
- an Ogg Vorbis data streamIOException
- Description of the Exceptionpublic static void main(String[] args) throws Exception
args
- The command line argumentsException
- Description of the Exceptionpublic int getChannels()
public long getRate()
public long getBitrate()
public Vector getComments(String field)
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. field
is case insensitive.field
- a case insensitive string for a field name in an Ogg Vorbis
comment headerpublic Set getFields()
Set
of comment field names in no particular order.Set
of comment field names in no particular
order.public String toString()
private void fetch_header_and_packet(InputStream s) throws IOException
s
- Description of the ParameterIOException
- Description of the Exceptionprivate void interpret_header_packet() throws IOException
IOException
- Description of the Exceptionprivate void fetch_info_info() throws IOException
IOException
- Description of the Exceptionprivate void fetch_comment_info() throws IOException
IOException
- Description of the Exceptionprivate int read32(byte[] data, int ptr)
data
- Description of the Parameterptr
- Description of the Parameterprivate byte[] checksum()
private long _ogg_crc_entry(long index)
index
- Description of the Parameterprivate long toulong(int n)
n
- Description of the Parameterprivate int touint(byte n)
n
- Description of the ParameterWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses