org.eclipse.actf.ai.voice

## Interface IVoice

    public interface IVoice

The IVoice interface enables an application to perform text synthesis operations.

### Field Summary

Fields
`static String` `PREF_ENGINE` A named preference that hold ID of current TTS engine
`static String` `PREF_SPEED` A named preference that hold speaking speed preferred by user
`static int` `SPEED_MAX` Maximum speaking speed
`static int` `SPEED_MIN` Minimum speaking speed
`static int` `SPEED_NORMAL` Normal speaking speed

### Method Summary

Methods
`int` `getSpeed()` Get current speaking speed
`ITTSEngine` `getTTSEngine()` Get current low-level TTS Engine interface.
`void` `setEventListener(IVoiceEventListener eventListener)` Set event listener in order to receive index event
`void` `setSpeed(int speed)` Set speaking speed
`void` `speak(String text, boolean flush)` Speak the contents of a text string without event listening
`void` `speak(String text, boolean flush, int index)` Speak the contents of a text string with event listening
`void` `stop()` Flash all pending speak request

### Field Detail

#### SPEED_MIN

    static final int SPEED_MIN

Minimum speaking speed

See Also:
  Constant Field Values

#### SPEED_MAX

    static final int SPEED_MAX

Maximum speaking speed

See Also:
  Constant Field Values

#### SPEED_NORMAL

    static final int SPEED_NORMAL

Normal speaking speed

See Also:
  Constant Field Values

#### PREF_ENGINE

    static final String PREF_ENGINE

A named preference that hold ID of current TTS engine

See Also:
  Constant Field Values

#### PREF_SPEED

    static final String PREF_SPEED

A named preference that hold speaking speed preferred by user

See Also:
  Constant Field Values

### Method Detail

#### speak

    void speak(String text,
             boolean flush)

Speak the contents of a text string without event listening

Parameters:
  `text` - text string to be spoken
  `flush` - true to flash all pending speak request prior to speak text false to append this request at end of speak request

#### speak

    void speak(String text,
             boolean flush,
             int index)

Speak the contents of a text string with event listening

Parameters:
  `text` - text string to be spoken
  `flush` - true to flash all pending speak request prior to speak text false to append this request at end of speak request
  `index` - positive int value to be reported via IVoiceEventListener Negative value will be ignored
See Also:
  `IVoiceEventListener`

#### stop

    void stop()

Flash all pending speak request

#### setSpeed

    void setSpeed(int speed)

Set speaking speed

Parameters:
  `speed` - speaking speed in range between 0 and 100 0: Minimum speed 50: Normal speed 100: Maximum speed

#### getSpeed

    int getSpeed()

Get current speaking speed

Returns:
  speaking speed in range between 0 and 100
See Also:
  `setSpeed(int)`

#### setEventListener

    void setEventListener(IVoiceEventListener eventListener)

Set event listener in order to receive index event

Parameters:
  `eventListener` -

#### getTTSEngine

    ITTSEngine getTTSEngine()

Get current low-level TTS Engine interface.
Please note: This function is provided for special voice application which requires precise control of TTS engine features. Use of low-level interface is generally not recommended.

Returns:
  ITTSEngine