public class SpeexFile extends Object implements OggAudioStream, OggAudioHeaders, Closeable
Constructor and Description |
---|
SpeexFile(File f)
Opens the given file for reading
|
SpeexFile(OggFile ogg)
Opens the given file for reading
|
SpeexFile(OggPacketReader r)
Loads a Speex File from the given packet reader.
|
SpeexFile(OutputStream out)
Opens for writing.
|
SpeexFile(OutputStream out,
int sid,
SpeexInfo info,
SpeexTags tags)
Opens for writing, based on the settings
from a pre-read file, with a specific
Steam ID (SID).
|
SpeexFile(OutputStream out,
SpeexInfo info,
SpeexTags tags)
Opens for writing, based on the settings
from a pre-read file.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
In Reading mode, will close the underlying ogg
file and free its resources.
|
SpeexInfo |
getInfo() |
SpeexAudioData |
getNextAudioPacket()
Returns the next
OggStreamAudioData packet in the
stream, or null if no more remain |
OggFile |
getOggFile()
Returns the underlying Ogg File instance
|
OggAudioSetupHeader |
getSetup()
Speex doesn't have setup headers, so this is always null
|
int |
getSid()
Returns the Ogg Stream ID
|
SpeexTags |
getTags() |
OggStreamIdentifier.OggStreamType |
getType()
This is a Speex file
|
void |
skipToGranule(long granulePosition)
Skips the audio data to the next packet with a granule
of at least the given granule position.
|
void |
writeAudioData(SpeexAudioData data)
Buffers the given audio ready for writing
out.
|
public SpeexFile(File f) throws IOException, FileNotFoundException
IOException
FileNotFoundException
public SpeexFile(OggFile ogg) throws IOException
IOException
public SpeexFile(OggPacketReader r) throws IOException
IOException
public SpeexFile(OutputStream out)
public SpeexFile(OutputStream out, SpeexInfo info, SpeexTags tags)
public SpeexFile(OutputStream out, int sid, SpeexInfo info, SpeexTags tags)
public SpeexAudioData getNextAudioPacket() throws IOException
OggAudioStream
OggStreamAudioData
packet in the
stream, or null if no more remaingetNextAudioPacket
in interface OggAudioStream
IOException
public void skipToGranule(long granulePosition) throws IOException
skipToGranule
in interface OggAudioStream
IOException
public int getSid()
getSid
in interface OggAudioHeaders
public OggStreamIdentifier.OggStreamType getType()
getType
in interface OggAudioHeaders
public SpeexInfo getInfo()
getInfo
in interface OggAudioHeaders
public SpeexTags getTags()
getTags
in interface OggAudioHeaders
public OggAudioSetupHeader getSetup()
getSetup
in interface OggAudioHeaders
public void writeAudioData(SpeexAudioData data)
close()
to do that,
because we assume you'll still be populating
the Info/Comment/Setup objectspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public OggFile getOggFile()
Copyright © 2015. All rights reserved.