Package com.vivoka.vsdk.audio
Class AudioProgress
java.lang.Object
com.vivoka.vsdk.audio.AudioProgress
Represents the progress of audio playback.
This class contains information about the current position in the audio stream,
the time in seconds, the audio buffer being played, and whether this is the last buffer
to be played.
It is used to track the playback state and provide updates on the audio being played.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal BufferRepresents the audio buffer being played.final booleanTrue if this is the last audio buffer to be played.final longRepresents the current position in the audio stream.final doubleRepresents the current time (in seconds) in the audio stream. -
Constructor Summary
ConstructorsConstructorDescriptionAudioProgress(long pos, int channelCount, int sampleRate, byte[] buffer, boolean last) Constructs an AudioProgress object with the specified parameters. -
Method Summary
-
Field Details
-
pos
public final long posRepresents the current position in the audio stream. It indicates where in the audio buffer the playback is currently at. This is the sample index of the audio being played. The value is in samples, not milliseconds. For example, if the sample rate is 16000 Hz, a position of 16000 would correspond to 1 second into the audio playback. -
time
public final double timeRepresents the current time (in seconds) in the audio stream. It indicates where in the audio buffer the playback is currently at. This is calculated based on the sample rate and the position in the audio stream. It indicates how far into the playback the current buffer is. -
buffer
Represents the audio buffer being played. This contains the audio data for the current playback segment. -
last
public final boolean lastTrue if this is the last audio buffer to be played.
-
-
Constructor Details
-
AudioProgress
public AudioProgress(long pos, int channelCount, int sampleRate, byte[] buffer, boolean last) Constructs an AudioProgress object with the specified parameters.- Parameters:
pos- The current position in the audio stream (in samples).channelCount- The number of audio channels (e.g., 1 for mono, 2 for stereo).sampleRate- The sample rate of the audio (e.g., 16000 Hz).buffer- The audio buffer containing the audio data.last- True if this is the last buffer to be played, false otherwise.
-