blob: ef5327e91ff16af8e4516d728d3c7befbe3228ff [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.accessibility.tts
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 11</span></div>
## **PROTOCOLS**
## Engine {#Engine}
*Defined in [fuchsia.accessibility.tts/tts.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts.fidl;l=43)*
<p>An interface to produce speech output.
Assistive technology use an Engine to start producing speech output and
set configuration parameters that control the speech.
TODO(fxbug.dev/17829): Implement pause, stop and resume.</p>
### Cancel {#Engine.Cancel}
<p>Cancels current speech and also empties the queue.</p>
#### Request {#Engine.Cancel_Request}
&lt;EMPTY&gt;
#### Response {#Engine.Cancel_Response}
&lt;EMPTY&gt;
### Enqueue {#Engine.Enqueue}
<p>Enqueues an utterance to be spoken. Speech is not started until Speak
is called.</p>
#### Request {#Engine.Enqueue_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>utterance</code></td>
<td>
<code><a class='link' href='#Utterance'>Utterance</a></code>
</td>
</tr>
</table>
#### Response {#Engine.Enqueue_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Engine_Enqueue_Result'>Engine_Enqueue_Result</a></code>
</td>
</tr>
</table>
### Speak {#Engine.Speak}
<p>Speaks all enqueued utterances. The method returns the value when they
are all finished playing.</p>
#### Request {#Engine.Speak_Request}
&lt;EMPTY&gt;
#### Response {#Engine.Speak_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Engine_Speak_Result'>Engine_Speak_Result</a></code>
</td>
</tr>
</table>
## EngineRegistry {#EngineRegistry}
*Defined in [fuchsia.accessibility.tts/tts_registration.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts_registration.fidl;l=8)*
<p>An interface for TTS Engines provide speech output.</p>
### RegisterEngine {#EngineRegistry.RegisterEngine}
<p>A TTS engine registers itself to start listening for incoming speech
output requests through <code>engine</code>.
At the moment, only one TTS Engine can be registered at a time.
This registry owners the first engine to register itself.
If an engine crashes and wants to register again, calling this method
will restart the connection. An error is returned if another engine is
already registered.</p>
#### Request {#EngineRegistry.RegisterEngine_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>engine</code></td>
<td>
<code><a class='link' href='#Engine'>Engine</a></code>
</td>
</tr>
</table>
#### Response {#EngineRegistry.RegisterEngine_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#EngineRegistry_RegisterEngine_Result'>EngineRegistry_RegisterEngine_Result</a></code>
</td>
</tr>
</table>
## TtsManager {#TtsManager}
*Defined in [fuchsia.accessibility.tts/tts_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts_manager.fidl;l=11)*
<p>An interface to manage TTS for assistive technology.</p>
<p>The TTS Manager offers assistive technology a way to open a TTS engine to
start producing speech output.</p>
### OpenEngine {#TtsManager.OpenEngine}
<p>A speaker is an assistive technology that wants to produce speech
output. Only one speaker is allowed to have an open connection to the
engine at a time. If already in use, BUSY error is returned.</p>
#### Request {#TtsManager.OpenEngine_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>engine_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Engine'>Engine</a>&gt;</code>
</td>
</tr>
</table>
#### Response {#TtsManager.OpenEngine_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#TtsManager_OpenEngine_Result'>TtsManager_OpenEngine_Result</a></code>
</td>
</tr>
</table>
## **STRUCTS**
### EngineRegistry_RegisterEngine_Response {#EngineRegistry_RegisterEngine_Response data-text="EngineRegistry_RegisterEngine_Response"}
*Defined in [fuchsia.accessibility.tts/tts_registration.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts_registration.fidl;l=18)*
&lt;EMPTY&gt;
### Engine_Enqueue_Response {#Engine_Enqueue_Response data-text="Engine_Enqueue_Response"}
*Defined in [fuchsia.accessibility.tts/tts.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts.fidl;l=48)*
&lt;EMPTY&gt;
### Engine_Speak_Response {#Engine_Speak_Response data-text="Engine_Speak_Response"}
*Defined in [fuchsia.accessibility.tts/tts.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts.fidl;l=52)*
&lt;EMPTY&gt;
### TtsManager_OpenEngine_Response {#TtsManager_OpenEngine_Response data-text="TtsManager_OpenEngine_Response"}
*Defined in [fuchsia.accessibility.tts/tts_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts_manager.fidl;l=17)*
&lt;EMPTY&gt;
## **ENUMS**
### Error [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Error data-text="Error"}
Type: <code>uint32</code>
*Defined in [fuchsia.accessibility.tts/tts.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts.fidl;l=10)*
<p>Error codes for TTS operations.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Error.NOT_IMPLEMENTED">
<td><h3 id="Error.NOT_IMPLEMENTED" class="add-link hide-from-toc">NOT_IMPLEMENTED</h3></td>
<td><code>1</code></td>
<td><p>The underlying TTS engine does not support this operation.</p>
</td>
</tr>
<tr id="Error.OUT_OF_RANGE">
<td><h3 id="Error.OUT_OF_RANGE" class="add-link hide-from-toc">OUT_OF_RANGE</h3></td>
<td><code>2</code></td>
<td><p>The value is out of range for a particular TTS parameter.</p>
</td>
</tr>
<tr id="Error.BAD_STATE">
<td><h3 id="Error.BAD_STATE" class="add-link hide-from-toc">BAD_STATE</h3></td>
<td><code>3</code></td>
<td><p>The operation is impossible to be completed.</p>
</td>
</tr>
<tr id="Error.BUSY">
<td><h3 id="Error.BUSY" class="add-link hide-from-toc">BUSY</h3></td>
<td><code>4</code></td>
<td><p>This operation can not be completed because the TTS service is in use.</p>
</td>
</tr>
</table>
## **TABLES**
### Utterance {#Utterance data-text="Utterance"}
*Defined in [fuchsia.accessibility.tts/tts.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts.fidl;l=29)*
<p>An utterance holds information about its message and how it should be spoken.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="Utterance.message">
<td><h3 id="Utterance.message" class="add-link hide-from-toc">1</h3></td>
<td><code>message</code></td>
<td>
<code>string</code>
</td>
<td><p>The message to be spoken.
Clients should pay attention to the FIDL maximum size for a message,
splitting when necessary into several utterances.</p>
</td>
</tr>
<tr id="Utterance.params">
<td><h3 id="Utterance.params" class="add-link hide-from-toc">2</h3></td>
<td><code>params</code></td>
<td>
<code><a class='link' href='#VoiceParameters'>VoiceParameters</a></code>
</td>
<td><p>Parameters that control the speech output.</p>
</td>
</tr>
</table>
### VoiceParameters {#VoiceParameters data-text="VoiceParameters"}
*Defined in [fuchsia.accessibility.tts/tts.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts.fidl;l=23)*
<p>Parameters of a voice.
TODO(fxbug.dev/16795): Add extra voice parameters such as speech rate and pitch.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="VoiceParameters.language">
<td><h3 id="VoiceParameters.language" class="add-link hide-from-toc">1</h3></td>
<td><code>language</code></td>
<td>
<code><a class='link' href='../fuchsia.intl/'>fuchsia.intl</a>/<a class='link' href='../fuchsia.intl/#LocaleId'>LocaleId</a></code>
</td>
<td><p>The current selected language.</p>
</td>
</tr>
</table>
## **UNIONS**
### EngineRegistry_RegisterEngine_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#EngineRegistry_RegisterEngine_Result data-text="EngineRegistry_RegisterEngine_Result"}
*Defined in [fuchsia.accessibility.tts/tts_registration.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts_registration.fidl;l=18)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="EngineRegistry_RegisterEngine_Result.response">
<td><h3 id="EngineRegistry_RegisterEngine_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#EngineRegistry_RegisterEngine_Response'>EngineRegistry_RegisterEngine_Response</a></code>
</td>
<td></td>
</tr>
<tr id="EngineRegistry_RegisterEngine_Result.err">
<td><h3 id="EngineRegistry_RegisterEngine_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='#Error'>Error</a></code>
</td>
<td></td>
</tr>
</table>
### Engine_Enqueue_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Engine_Enqueue_Result data-text="Engine_Enqueue_Result"}
*Defined in [fuchsia.accessibility.tts/tts.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts.fidl;l=48)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Engine_Enqueue_Result.response">
<td><h3 id="Engine_Enqueue_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Engine_Enqueue_Response'>Engine_Enqueue_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Engine_Enqueue_Result.err">
<td><h3 id="Engine_Enqueue_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='#Error'>Error</a></code>
</td>
<td></td>
</tr>
</table>
### Engine_Speak_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Engine_Speak_Result data-text="Engine_Speak_Result"}
*Defined in [fuchsia.accessibility.tts/tts.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts.fidl;l=52)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Engine_Speak_Result.response">
<td><h3 id="Engine_Speak_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Engine_Speak_Response'>Engine_Speak_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Engine_Speak_Result.err">
<td><h3 id="Engine_Speak_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='#Error'>Error</a></code>
</td>
<td></td>
</tr>
</table>
### TtsManager_OpenEngine_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#TtsManager_OpenEngine_Result data-text="TtsManager_OpenEngine_Result"}
*Defined in [fuchsia.accessibility.tts/tts_manager.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.accessibility.tts/tts_manager.fidl;l=17)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="TtsManager_OpenEngine_Result.response">
<td><h3 id="TtsManager_OpenEngine_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#TtsManager_OpenEngine_Response'>TtsManager_OpenEngine_Response</a></code>
</td>
<td></td>
</tr>
<tr id="TtsManager_OpenEngine_Result.err">
<td><h3 id="TtsManager_OpenEngine_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='#Error'>Error</a></code>
</td>
<td></td>
</tr>
</table>