Class MutableAudioFrame
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.track.playback.AbstractMutableAudioFrame
-
- com.sedmelluq.discord.lavaplayer.track.playback.MutableAudioFrame
-
- All Implemented Interfaces:
AudioFrame
public class MutableAudioFrame extends AbstractMutableAudioFrame
A mutable audio frame.
-
-
Constructor Summary
Constructors Constructor Description MutableAudioFrame()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getData()voidgetData(byte[] buffer, int offset)Before calling this method, the caller should verify that the data fits in the buffer usingAudioFrame.getDataLength().intgetDataLength()voidsetBuffer(java.nio.ByteBuffer frameBuffer)This should be called only by the requester of a frame.voidstore(byte[] buffer, int offset, int length)This should be called only by the provider of a frame.-
Methods inherited from class com.sedmelluq.discord.lavaplayer.track.playback.AbstractMutableAudioFrame
freeze, getFormat, getTimecode, getVolume, isTerminator, setFormat, setTerminator, setTimecode, setVolume
-
-
-
-
Method Detail
-
setBuffer
public void setBuffer(java.nio.ByteBuffer frameBuffer)
This should be called only by the requester of a frame.- Parameters:
frameBuffer- Buffer to use internally.
-
store
public void store(byte[] buffer, int offset, int length)This should be called only by the provider of a frame.- Parameters:
buffer- Buffer to copy data from into the internal buffer of this instance.offset- Offset in the buffer.length- Length of the data to copy.
-
getDataLength
public int getDataLength()
- Returns:
- Length of the data of this frame.
-
getData
public byte[] getData()
- Returns:
- Byte array with the frame data.
-
getData
public void getData(byte[] buffer, int offset)Description copied from interface:AudioFrameBefore calling this method, the caller should verify that the data fits in the buffer usingAudioFrame.getDataLength().- Parameters:
buffer- Buffer to write the frame data to.offset- Offset in the buffer to start writing at.
-
-