nsISpeechTask

A task is associated with a single utterance. It is provided by the browser
to the service in the speak() method.

Methods

setup(aCallback, aChannels, aRate)

Prepare browser for speech.

Parameters

aCallback callback object for mid-speech operations.
aChannels number of audio channels. Only required in direct audio services
aRate audio rate. Only required in direct audio services

sendAudio(aData, aLandmarks)

Send audio data to browser.

Parameters

aData an Int16Array with PCM-16 audio data.
aLandmarks an array of sample offset and landmark pairs. Used for emiting boundary and mark events.

sendAudioNative(aData, aDataLen)

dispatchStart()

Dispatch start event.

dispatchEnd(aElapsedTime, aCharIndex)

Dispatch end event.

Parameters

aElapsedTime time in seconds since speech has started.
aCharIndex offset of spoken characters.

dispatchPause(aElapsedTime, aCharIndex)

Dispatch pause event. Should not be called directly by service.

Parameters

aElapsedTime time in seconds since speech has started.
aCharIndex offset of spoken characters.

dispatchResume(aElapsedTime, aCharIndex)

Dispatch resume event. Should not be called directly by service.

Parameters

aElapsedTime time in seconds since speech has started.
aCharIndex offset of spoken characters.

dispatchError(aElapsedTime, aCharIndex)

Dispatch error event.

Parameters

aElapsedTime time in seconds since speech has started.
aCharIndex offset of spoken characters.

dispatchBoundary(aName, aElapsedTime, aCharIndex)

Dispatch boundary event.

Parameters

aName name of boundary, 'word' or 'sentence'
aElapsedTime time in seconds since speech has started.
aCharIndex offset of spoken characters.

dispatchMark(aName, aElapsedTime, aCharIndex)

Dispatch mark event.

Parameters

aName mark identifier.
aElapsedTime time in seconds since speech has started.
aCharIndex offset of spoken characters.