Class BufferModuleIn

java.lang.Object
com.vivoka.vsdk.audio.consumers.BufferModuleIn
All Implemented Interfaces:
IConsumerModule

public class BufferModuleIn extends Object implements IConsumerModule
Represents a module that consumes audio buffers and appends them to a buffer that can be retrieved for playback or further processing.
  • Constructor Details

    • BufferModuleIn

      public BufferModuleIn(int channelCount, int sampleRate) throws Exception
      Constructs a BufferModuleIn with the specified channel count and sample rate. This module will create a Buffer that can hold audio data for the specified number of channels and sample rate.
      Parameters:
      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).
      Throws:
      Exception - If there is an error creating the Buffer object.
  • Method Details

    • getBuffer

      public Buffer getBuffer()
      Retrieves the Buffer that this module is consuming audio into. This buffer can be used to access the audio data that has been appended.
      Returns:
      The Buffer containing the audio data.
    • process

      public void process(Buffer buffer, boolean last) throws Exception
      Description copied from interface: IConsumerModule
      Processes the given audio buffer.
      Specified by:
      process in interface IConsumerModule
      Parameters:
      buffer - The audio buffer to process.
      last - Indicates if this is the last buffer in the stream.
      Throws:
      Exception - If an error occurs during processing.