Build 1.0_r1(from source)

android.speech.recognition.impl
Class MicrophoneImpl

java.lang.Object
  extended by android.speech.recognition.Microphone
      extended by android.speech.recognition.impl.MicrophoneImpl
All Implemented Interfaces:
AudioSource, Runnable

public class MicrophoneImpl
extends Microphone
implements Runnable


Method Summary
 AudioStream createAudio()
          Creates an audio source
protected  void finalize()
          Called by the virtual machine when there are no longer any (non-weak) references to the receiver.
static MicrophoneImpl getInstance()
          Returns the singleton instance.
 void run()
          Begin doing the active part of the class' code.
 void setCodec(Codec recordingCodec)
          set the recording codec.
 void setListener(AudioSourceListener listener)
          set the microphone listener.
 void start()
          Start recording audio.
 void stop()
          Stops recording audio.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

run

public void run()
Description copied from interface: Runnable
Begin doing the active part of the class' code.

Specified by:
run in interface Runnable

getInstance

public static MicrophoneImpl getInstance()
Returns the singleton instance.

Returns:
the singleton instance

setCodec

public void setCodec(Codec recordingCodec)
set the recording codec. This must be called before Start is called.

Specified by:
setCodec in class Microphone
Parameters:
recordingCodec - the codec in which the samples will be recorded.

setListener

public void setListener(AudioSourceListener listener)
set the microphone listener.

Specified by:
setListener in class Microphone
Parameters:
listener - the microphone listener.

createAudio

public AudioStream createAudio()
Description copied from class: Microphone
Creates an audio source

Specified by:
createAudio in interface AudioSource
Specified by:
createAudio in class Microphone
Returns:
an AudioStream instance

start

public void start()
Description copied from class: Microphone
Start recording audio.

Specified by:
start in interface AudioSource
Specified by:
start in class Microphone

stop

public void stop()
Description copied from class: Microphone
Stops recording audio.

Specified by:
stop in interface AudioSource
Specified by:
stop in class Microphone

finalize

protected void finalize()
                 throws Throwable
Description copied from class: Object
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. Subclasses can use this facility to guarantee that any associated resources are cleaned up before the receiver is garbage collected. Uncaught exceptions which are thrown during the running of the method cause it to terminate immediately, but are otherwise ignored.

Note: The virtual machine assumes that the implementation in class Object is empty.

Overrides:
finalize in class Object
Throws:
Throwable - The virtual machine ignores any exceptions which are thrown during finalization.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature