Class CaptureConfig
java.lang.Object
de.pottgames.tuningfork.capture.CaptureConfig
A class that helps configuring a
CaptureDevice.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newCaptureConfigwith default settings.CaptureConfig(String deviceSpecifier, PcmFormat pcmFormat, int frequency, int bufferSize, TuningForkLogger logger) Creates a newCaptureConfigwith all values specified. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the configs value for the buffer size.Returns the configs value for the device specifier.intReturns the configs value for the frequency.Returns the configs value for the logger.Returns the configs value for the pcm format.setBufferSize(int bufferSize) OpenAL uses a ring buffer internally to record audio data.setDeviceSpecifier(String deviceSpecifier) Sets the requested device name specifier.setFrequency(int frequency) Sets the requested frequency for theCaptureDevice.setLogger(TuningForkLogger logger) Sets the logger to use for theCaptureDevice.setPcmFormat(PcmFormat pcmFormat) Sets the requested pcm format for theCaptureDevice.
-
Constructor Details
-
CaptureConfig
public CaptureConfig()Creates a newCaptureConfigwith default settings. -
CaptureConfig
public CaptureConfig(String deviceSpecifier, PcmFormat pcmFormat, int frequency, int bufferSize, TuningForkLogger logger) Creates a newCaptureConfigwith all values specified.- Parameters:
deviceSpecifier- the device namepcmFormat- the pcm formatfrequency- the frequencybufferSize- the buffer sizelogger- the TuningForkLogger
-
-
Method Details
-
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
Returns the configs value for the device specifier.- Returns:
- the device specifier
-
getLogger
-
setPcmFormat
Sets the requested pcm format for theCaptureDevice.- Parameters:
pcmFormat- the pcm format- Returns:
- this
-
setFrequency
Sets the requested frequency for theCaptureDevice. Use common values like 44100, 48000, etc. - other values might not be supported by the driver.- Parameters:
frequency- the frequency- Returns:
- this
-
setBufferSize
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
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
Sets the logger to use for theCaptureDevice. May be null to disable logging.- Parameters:
logger- the TuningForkLogger- Returns:
- this
-