public class OpusFile extends Object implements OggAudioStream, OggAudioHeaders, Closeable
| Constructor and Description |
|---|
OpusFile(File f)
Opens the given file for reading
|
OpusFile(OggFile ogg)
Opens the given file for reading
|
OpusFile(OggPacketReader r)
Loads a Opus File from the given packet reader.
|
OpusFile(OutputStream out)
Opens for writing.
|
OpusFile(OutputStream out,
int sid,
OpusInfo info,
OpusTags tags)
Opens for writing, based on the settings
from a pre-read file, with a specific
Steam ID (SID).
|
OpusFile(OutputStream out,
OpusInfo info,
OpusTags 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.
|
OpusInfo |
getInfo() |
OpusAudioData |
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()
Opus doesn't have setup headers, so this is always null
|
int |
getSid()
Returns the Ogg Stream ID
|
OpusTags |
getTags() |
OggStreamIdentifier.OggStreamType |
getType()
This is an Opus 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(OpusAudioData data)
Buffers the given audio ready for writing
out.
|
public OpusFile(File f) throws IOException, FileNotFoundException
IOExceptionFileNotFoundExceptionpublic OpusFile(OggFile ogg) throws IOException
IOExceptionpublic OpusFile(OggPacketReader r) throws IOException
IOExceptionpublic OpusFile(OutputStream out)
public OpusFile(OutputStream out, OpusInfo info, OpusTags tags)
public OpusFile(OutputStream out, int sid, OpusInfo info, OpusTags tags)
public OpusAudioData getNextAudioPacket() throws IOException
OggAudioStreamOggStreamAudioData packet in the
stream, or null if no more remaingetNextAudioPacket in interface OggAudioStreamIOExceptionpublic void skipToGranule(long granulePosition)
throws IOException
skipToGranule in interface OggAudioStreamIOExceptionpublic int getSid()
getSid in interface OggAudioHeaderspublic OggStreamIdentifier.OggStreamType getType()
getType in interface OggAudioHeaderspublic OpusInfo getInfo()
getInfo in interface OggAudioHeaderspublic OpusTags getTags()
getTags in interface OggAudioHeaderspublic OggAudioSetupHeader getSetup()
getSetup in interface OggAudioHeaderspublic void writeAudioData(OpusAudioData 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 Closeableclose in interface AutoCloseableIOExceptionpublic OggFile getOggFile()
Copyright © 2021. All rights reserved.