MicStream
JavaScript is disabled on your browser.
br.usp.ime.dspbenchmarking.streams
Class MicStream
- java.lang.Object
-
- br.usp.ime.dspbenchmarking.streams.AudioStream
-
- br.usp.ime.dspbenchmarking.streams.MicStream
-
public class MicStream extends AudioStream
An audio stream that comes from a microphone.
-
-
Field Summary
Fields Modifier and Type Field and Description private int
bufferSize
private int
ix
(package private) AudioRecord.OnRecordPositionUpdateListener
microphoneDspCallback
Listener for when using AUDIO_SOURCE_MICROPHONE.(package private) AudioRecord
recorder
private int
sampleRate
-
Fields inherited from class br.usp.ime.dspbenchmarking.streams.AudioStream
blockSize, callbackPeriod, dspCallback, isRunning, readTicks, sampleReadTime
-
-
Constructor Summary
Constructors Constructor and Description MicStream(int bufSize, int sRate, int blSize)
The constructor instantiates an AudioRecord instance with the given configuration.
-
Method Summary
Methods Modifier and Type Method and Description int
blocks()
This is just a placeholder because such a method has to be implemented.int
getBufferSize()
Get the size of the buffer to store samples from input.int
getMinBufferSize()
Returns the minumum buffer size for a given DSP configuration.void
readLoop(short[] buffer)
void
scheduleDspCallback(long blockPeriodNanoseconds)
Schedule a periodic call for the DSP callback.void
stopRunning()
-
Methods inherited from class br.usp.ime.dspbenchmarking.streams.AudioStream
createBuffer, getCallbackPeriod, getReadTicks, getSampleReadTime, reset, setBlockSize, setDspCallback
-
-
-
-
Field Detail
-
bufferSize
private int bufferSize
-
sampleRate
private int sampleRate
-
ix
private int ix
-
recorder
AudioRecord recorder
-
microphoneDspCallback
AudioRecord.OnRecordPositionUpdateListener microphoneDspCallback
Listener for when using AUDIO_SOURCE_MICROPHONE.
-
-
Constructor Detail
-
MicStream
public MicStream(int bufSize, int sRate, int blSize)
The constructor instantiates an AudioRecord instance with the given configuration.- Parameters:
bufSize
-sRate
-blSize
-
-
-
Method Detail
-
getBufferSize
public int getBufferSize()
Get the size of the buffer to store samples from input.- Specified by:
getBufferSize
in classAudioStream
-
scheduleDspCallback
public void scheduleDspCallback(long blockPeriodNanoseconds)
Schedule a periodic call for the DSP callback.- Specified by:
scheduleDspCallback
in classAudioStream
-
blocks
public int blocks()
This is just a placeholder because such a method has to be implemented.- Specified by:
blocks
in classAudioStream
-
stopRunning
public void stopRunning()
- Specified by:
stopRunning
in classAudioStream
-
getMinBufferSize
public int getMinBufferSize()
Returns the minumum buffer size for a given DSP configuration.- Specified by:
getMinBufferSize
in classAudioStream
- Returns:
-
readLoop
public void readLoop(short[] buffer)
- Specified by:
readLoop
in classAudioStream
-
-