AudioStream
JavaScript is disabled on your browser.

br.usp.ime.dspbenchmarking.streams

Class AudioStream

  • java.lang.Object
    • br.usp.ime.dspbenchmarking.streams.AudioStream
  • Direct Known Subclasses:
    MicStream, WavStream


    public abstract class AudioStream
    extends java.lang.Object
    An AudioStream is a stream of input audio signal. This abstract class may be implemented to provide input audio streams of many types, such as from microphones, audio files and others. Each AudioStream implementation is responsible for executing a DspCallback periodically, which will in turn execute an algorithm over a block of samples.
    • Field Detail

      • callbackPeriod

        protected long callbackPeriod
      • readTicks

        protected long readTicks
      • sampleReadTime

        protected long sampleReadTime
      • isRunning

        protected boolean isRunning
      • blockSize

        protected int blockSize
    • Constructor Detail

      • AudioStream

        public AudioStream()
    • Method Detail

      • getBufferSize

        public abstract int getBufferSize()
      • scheduleDspCallback

        public abstract void scheduleDspCallback(long blockPeriodNanoseconds)
      • readLoop

        public abstract void readLoop(short[] buffer)
      • blocks

        public abstract int blocks()
      • stopRunning

        public abstract void stopRunning()
      • getMinBufferSize

        public abstract int getMinBufferSize()
      • setBlockSize

        public void setBlockSize(int bSize)
        Set the block size for the signal processing of the stream.
        Parameters:
        bSize -
      • getCallbackPeriod

        public long getCallbackPeriod()
        Returns:
        The sum of the periods of callback calls.
      • getReadTicks

        public long getReadTicks()
        Returns:
        The amount of times blocks were read from input.
      • getSampleReadTime

        public long getSampleReadTime()
        Returns:
        The sum of the time taken to read from input.
      • reset

        public void reset()
        Reset the audio stream parameters.
      • createBuffer

        public short[] createBuffer()
        Create a new buffer to store input samples.