public class OggOpusEnc extends OpusWriter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT_NOTICE
The Constant COPYRIGHT_NOTICE.
|
audioConsumer, PACKETS_PER_OGG_PAGE, pageCount, sampleRate, streamSerialNumber
Constructor and Description |
---|
OggOpusEnc(AudioConsumer ac)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close writer.
|
int |
encodeAndWrite(byte[] rawAudio)
Encode raw audio data into Opus format then call OpusWriter to write the Ogg packet.
|
void |
initEncoder(AudioConsumer ac)
For WebSocketClient.
|
void |
onStart()
When the encode begins.
|
flush, open, open, write, write, writeHeader, writePacket
buildOggPageHeader, buildOpusComment, buildOpusHeader, writeInt, writeInt, writeInt, writeLong, writeLong, writeOggPageHeader, writeOpusComment, writeOpusHeader, writeShort, writeShort, writeShort, writeString
public static final java.lang.String COPYRIGHT_NOTICE
public OggOpusEnc(AudioConsumer ac) throws java.io.IOException
ac
- the acjava.io.IOException
- Signals that an I/O exception has occurred.public void initEncoder(AudioConsumer ac) throws java.io.IOException
ac
- the acjava.io.IOException
- Signals that an I/O exception has occurred.public void onStart()
public int encodeAndWrite(byte[] rawAudio) throws java.io.IOException
rawAudio
- the raw audiojava.io.IOException
- Signals that an I/O exception has occurred.public void close()
close
in class OpusWriter