MicStream
JavaScript is disabled on your browser.

br.usp.ime.dspbenchmarking.streams

Class MicStream



  • public class MicStream
    extends AudioStream
    An audio stream that comes from a microphone.
    • 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 class AudioStream
      • scheduleDspCallback

        public void scheduleDspCallback(long blockPeriodNanoseconds)
        Schedule a periodic call for the DSP callback.
        Specified by:
        scheduleDspCallback in class AudioStream
      • blocks

        public int blocks()
        This is just a placeholder because such a method has to be implemented.
        Specified by:
        blocks in class AudioStream
      • getMinBufferSize

        public int getMinBufferSize()
        Returns the minumum buffer size for a given DSP configuration.
        Specified by:
        getMinBufferSize in class AudioStream
        Returns:
      • readLoop

        public void readLoop(short[] buffer)
        Specified by:
        readLoop in class AudioStream