org.gagravarr.flac
Class FlacFile

java.lang.Object
  extended by org.gagravarr.flac.FlacFile
Direct Known Subclasses:
FlacNativeFile, FlacOggFile

public abstract class FlacFile
extends Object

This wrapper lets you work with FLAC files, whether they're Ogg or Native framed.


Field Summary
protected  FlacInfo info
           
protected  List<FlacMetadataBlock> otherMetadata
           
protected  FlacTags tags
           
 
Constructor Summary
FlacFile()
           
 
Method Summary
abstract  void close()
          In Reading mode, will close the underlying ogg/flac file and free its resources.
 FlacInfo getInfo()
           
abstract  FlacAudioFrame getNextAudioPacket()
           
 FlacTags getTags()
           
static FlacFile open(File f)
          Opens the given file for reading
static FlacFile open(InputStream inp)
          Opens the given file for reading.
static FlacFile open(OggFile ogg)
          Opens the given file for reading
abstract  void skipToGranule(long granulePosition)
          Skips the audio data to the next packet with a granule of at least the given granule position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected FlacInfo info

tags

protected FlacTags tags

otherMetadata

protected List<FlacMetadataBlock> otherMetadata
Constructor Detail

FlacFile

public FlacFile()
Method Detail

open

public static FlacFile open(File f)
                     throws IOException,
                            FileNotFoundException
Opens the given file for reading

Throws:
IOException
FileNotFoundException

open

public static FlacFile open(InputStream inp)
                     throws IOException,
                            FileNotFoundException
Opens the given file for reading.

Parameters:
inp - The InputStrem to read from, which must support mark/reset
Throws:
IOException
FileNotFoundException

open

public static FlacFile open(OggFile ogg)
                     throws IOException
Opens the given file for reading

Throws:
IOException

getNextAudioPacket

public abstract FlacAudioFrame getNextAudioPacket()
                                           throws IOException
Throws:
IOException

skipToGranule

public abstract void skipToGranule(long granulePosition)
                            throws IOException
Skips the audio data to the next packet with a granule of at least the given granule position. Note that skipping backwards is not currently supported!

Throws:
IOException

getInfo

public FlacInfo getInfo()

getTags

public FlacTags getTags()

close

public abstract void close()
                    throws IOException
In Reading mode, will close the underlying ogg/flac file and free its resources. In Writing mode, will write out the Info and Comments objects, and then the audio data.

Throws:
IOException


Copyright © 2012. All Rights Reserved.