Class AudioProgress

java.lang.Object
com.vivoka.vsdk.audio.AudioProgress

public class AudioProgress extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    final Buffer
    Represents the audio buffer being played.
    final boolean
    True if this is the last audio buffer to be played.
    final long
    Represents the current position in the audio stream.
    final double
    Represents the current time (in seconds) in the audio stream.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AudioProgress(long pos, int channelCount, int sampleRate, byte[] buffer, boolean last)
    Constructs an AudioProgress object with the specified parameters.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • pos

      public final long pos
      Represents 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 time
      Represents 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

      public final Buffer buffer
      Represents the audio buffer being played. This contains the audio data for the current playback segment.
    • last

      public final boolean last
      True 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.