SpeechComponent

SpeechComponent

The Speech Component.
Adds text-to-speech functionality to an entity.

Constructor

new SpeechComponent()

Members

speeches

Current speeches in the entity. Add a speech using SpeechComponent#addSpeech

Methods

addSpeech(speech)

Add a speech to the component

Parameters:
Name Type Description
speech Speech

getSpatial() → {boolean}

Get spatial field of speechComponent

getSpeechById(id)

Get a component's speech by id.

Parameters:
Name Type Description
id string

getVoice() → {string}

Get the current Voice Id

pause()

pause all speeches if they are playing

process(settings, mvMat)

Processes each speech attached to the component.
Called once per frame while scene is playing.

Parameters:
Name Type Description
settings Object

settings for pannerNode

mvMat Matrix4

relative transform matrix for pannerNode

removeSpeech(speech)

Remove a speech from the component.

Parameters:
Name Type Description
speech Speech

resume()

resume all speeches if they were playing

setSpatial(spatial)

Set spatial field of speechComponent

Parameters:
Name Type Description
spatial boolean

setVoice(voice) → {Promise}

Sets the voice for all speeches on the Speech Component.

Parameters:
Name Type Description
voice string

Voice Id of the voice (e.g. "Amy")

stop()

Stop all speeches