org.hermit.android.io
Class AudioReader

java.lang.Object
  extended by org.hermit.android.io.AudioReader

public class AudioReader
extends java.lang.Object

A class which reads audio input from the mic in a background thread and passes it to the caller when ready.

To use this class, your application must have permission RECORD_AUDIO.


Nested Class Summary
static class AudioReader.Listener
          Listener for audio reads.
 
Constructor Summary
AudioReader()
          Create an AudioReader instance.
 
Method Summary
 void startReader(int rate, int block, AudioReader.Listener listener)
          Start this reader.
 void stopReader()
          Start this reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioReader

public AudioReader()
Create an AudioReader instance.

Method Detail

startReader

public void startReader(int rate,
                        int block,
                        AudioReader.Listener listener)
Start this reader.

Parameters:
rate - The audio sampling rate, in samples / sec.
block - Number of samples of input to read at a time. This is different from the system audio buffer size.
listener - Listener to be notified on each completed read.

stopReader

public void stopReader()
Start this reader.