| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // Next MinVersion: 4 |
| |
| module arc.mojom; |
| |
| [Extensible] |
| enum TtsEventType { |
| START = 0, |
| END, |
| INTERRUPTED, |
| ERROR, |
| WORD |
| }; |
| |
| // Represents a tts utterance sent from Chrome to Android. |
| struct TtsUtterance { |
| uint32 utteranceId; |
| string text; |
| double rate; |
| double pitch; |
| [MinVersion=2] uint32 voice_id; |
| }; |
| |
| // Represents a tts voice sent from Android to Chrome. |
| struct TtsVoice { |
| uint32 id; |
| string name; |
| string locale; |
| bool is_network_connection_required; |
| }; |
| |
| // Next Method ID: 3 |
| interface TtsHost { |
| // Notifies Chrome of Android tts events. |
| OnTtsEventDeprecated@0(uint32 utteranceId, |
| TtsEventType event_type, |
| uint32 char_index, |
| string error_msg); |
| |
| // Notifies Chrome of Android tts voices. |
| [MinVersion=2] OnVoicesChanged@1(array<TtsVoice> voices); |
| |
| // Notifies Chrome of Android tts events. |
| [MinVersion=3] OnTtsEvent@2(uint32 utteranceId, |
| TtsEventType event_type, |
| uint32 char_index, |
| uint32 length, |
| string error_msg); |
| }; |
| |
| // Next Method ID: 4 |
| interface TtsInstance { |
| // DEPRECATED: Please use Init@3 instead. |
| InitDeprecated@0(pending_remote<TtsHost> host_remote); |
| |
| // Establishes full-duplex communication with the host. |
| [MinVersion=1] Init@3(pending_remote<TtsHost> host_remote) => (); |
| |
| // Sends an utterance to Android for synthesis. |
| Speak@1(TtsUtterance utterance); |
| |
| // Sends a stop request to Android text to speech. |
| Stop@2(); |
| }; |