Build 1.0_r1(from source)

android.speech.recognition
Class DeviceSpeaker

java.lang.Object
  extended by android.speech.recognition.DeviceSpeaker
Direct Known Subclasses:
DeviceSpeakerImpl

public abstract class DeviceSpeaker
extends Object

A device for transforming electric signals into audible sound, most frequently used to reproduce speech and music.


Constructor Summary
DeviceSpeaker()
           
 
Method Summary
static DeviceSpeaker getInstance()
          Returns the device speaker instance.
abstract  void setCodec(Codec playbackCodec)
          Sets the playback codec.
abstract  void setListener(DeviceSpeakerListener listener)
          Sets the microphone listener.
abstract  void start(AudioStream source)
          Starts the audio playback.
abstract  void stop()
          Stops audio playback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceSpeaker

public DeviceSpeaker()
Method Detail

getInstance

public static DeviceSpeaker getInstance()
Returns the device speaker instance.

Returns:
an instance of a DeviceSpeaker class.

start

public abstract void start(AudioStream source)
                    throws IllegalStateException,
                           IllegalArgumentException
Starts the audio playback.

Parameters:
source - the audio to play
Throws:
IllegalStateException - if the component is already started
IllegalArgumentException - if source audio is null, in-use by another component or is empty.

stop

public abstract void stop()
Stops audio playback.


setCodec

public abstract void setCodec(Codec playbackCodec)
                       throws IllegalStateException,
                              IllegalArgumentException
Sets the playback codec. This must be called before start() is called.

Parameters:
playbackCodec - the codec to use for the playback operation.
Throws:
IllegalStateException - if the component is already stopped
IllegalArgumentException - if the specified codec is not supported

setListener

public abstract void setListener(DeviceSpeakerListener listener)
                          throws IllegalStateException
Sets the microphone listener.

Parameters:
listener - the device speaker listener.
Throws:
IllegalStateException - if the component is started

Build 1.0_r1(from source)

Please submit a feedback, bug or feature