public class AudioFrame extends MediaFrame
AudioFrame contains audio samples with a specific AudioFormat
that describes the characteristics of the samples. Depending on how many channels
the audio of this frame has, each channel can be accessed with getPlane().MediaFrame.Type| Constructor and Description |
|---|
AudioFrame(AudioFormat format,
int samples)
Creates a new
AudioFrame with descriptive format and allocates memory
for the specified amount of samples. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Free the memory of sample buffers.
|
AudioFormat |
getAudioFormat()
Get the audio format of containing samples.
|
int |
getBufferSize()
Get buffer size per plane.
|
com.googlecode.javacpp.PointerPointer |
getData()
Get sample data pointers.
|
com.googlecode.javacpp.BytePointer |
getPlane(int index)
Get pointer to audio plane at specified index.
|
int |
getPlaneCount()
Get the number of audio planes/channels.
|
com.googlecode.javacpp.BytePointer[] |
getPlanes()
Get pointers to all audio planes.
|
int |
getSampleCount()
Get the number of samples in this frame.
|
MediaFrame.Type |
getType() |
boolean |
hasFrame() |
void |
setSampleCount(int samples)
Set the number of samples in this frame.
|
getTimestamp, isKeyFrame, setKeyFrame, setTimestamppublic AudioFrame(AudioFormat format, int samples)
AudioFrame with descriptive format and allocates memory
for the specified amount of samples.format - the format of the samples.samples - the amount of samples.public AudioFormat getAudioFormat()
public com.googlecode.javacpp.PointerPointer getData()
public int getBufferSize()
public com.googlecode.javacpp.BytePointer[] getPlanes()
public com.googlecode.javacpp.BytePointer getPlane(int index)
index - the plane index.public int getPlaneCount()
public void setSampleCount(int samples)
samples - the number of samples to set.public int getSampleCount()
public MediaFrame.Type getType()
getType in class MediaFramepublic boolean hasFrame()
hasFrame in class MediaFramepublic void clear()
Copyright © 2013. All Rights Reserved.