Class CaptureConfig

java.lang.Object
de.pottgames.tuningfork.capture.CaptureConfig

public class CaptureConfig extends Object
A class that helps configuring a CaptureDevice.
  • Constructor Details

    • CaptureConfig

      public CaptureConfig()
      Creates a new CaptureConfig with default settings.
    • CaptureConfig

      public CaptureConfig(String deviceSpecifier, PcmFormat pcmFormat, int frequency, int bufferSize, TuningForkLogger logger)
      Creates a new CaptureConfig with all values specified.
      Parameters:
      deviceSpecifier - the device name
      pcmFormat - the pcm format
      frequency - the frequency
      bufferSize - the buffer size
      logger - the TuningForkLogger
  • Method Details

    • getPcmFormat

      public PcmFormat getPcmFormat()
      Returns the configs value for the pcm format.
      Returns:
      the pcm format
    • getFrequency

      public int getFrequency()
      Returns the configs value for the frequency.
      Returns:
      the frequency
    • getBufferSize

      public int getBufferSize()
      Returns the configs value for the buffer size.
      Returns:
      the buffer size
    • getDeviceSpecifier

      public String getDeviceSpecifier()
      Returns the configs value for the device specifier.
      Returns:
      the device specifier
    • getLogger

      public TuningForkLogger getLogger()
      Returns the configs value for the logger.
      Returns:
      the logger
    • setPcmFormat

      public CaptureConfig setPcmFormat(PcmFormat pcmFormat)
      Sets the requested pcm format for the CaptureDevice.
      Parameters:
      pcmFormat - the pcm format
      Returns:
      this
    • setFrequency

      public CaptureConfig setFrequency(int frequency)
      Sets the requested frequency for the CaptureDevice. Use common values like 44100, 48000, etc. - other values might not be supported by the driver.
      Parameters:
      frequency - the frequency
      Returns:
      this
    • setBufferSize

      public CaptureConfig setBufferSize(int bufferSize)
      OpenAL uses a ring buffer internally to record audio data. If the buffer is full, it starts to overwrite the existing data. The buffer size defines how much audio data can be recorded before it gets overwritten.
      Note: The implementation may use a larger buffer than requested if it needs to, but the implementation will set up a buffer of at least the requested size.
      Parameters:
      bufferSize - in samples
      Returns:
      this
    • setDeviceSpecifier

      public CaptureConfig setDeviceSpecifier(String deviceSpecifier)
      Sets the requested device name specifier. May be null if you want to request the default input device.
      Parameters:
      deviceSpecifier - the device name
      Returns:
      this
    • setLogger

      public CaptureConfig setLogger(TuningForkLogger logger)
      Sets the logger to use for the CaptureDevice. May be null to disable logging.
      Parameters:
      logger - the TuningForkLogger
      Returns:
      this