Voice
open class Voice : Parcelable
| kotlin.Any | |
| ↳ | android.speech.tts.Voice |
Characteristics and features of a Text-To-Speech Voice. Each TTS Engine can expose multiple voices for each locale, with different set of features.
Summary
| Constants | |
|---|---|
| static Int |
Network based expected synthesizer latency (~200ms) |
| static Int |
Low expected synthesizer latency (~20ms) |
| static Int |
Normal expected synthesizer latency (~50ms) |
| static Int |
Very slow network based expected synthesizer latency (> 200ms) |
| static Int |
Very low expected synthesizer latency (< 20ms) |
| static Int |
High, human-like quality of speech synthesis |
| static Int |
Low, not human-like quality of speech synthesis |
| static Int |
Normal quality of speech synthesis |
| static Int |
Very high, almost human-indistinguishable quality of speech synthesis |
| static Int |
Very low, but still intelligible quality of speech synthesis |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| open Int | |
| open Boolean |
Indicates whether some other object is "equal to" this one. |
| open MutableSet<String!>! |
Returns the set of features it supports for a given voice. |
| open Int | |
| open Locale! | |
| open String! |
getName() |
| open Int | |
| open Int |
hashCode() |
| open Boolean | |
| open String |
toString() |
| open Unit |
writeToParcel(dest: Parcel, flags: Int) |
| Properties | |
|---|---|
| static Parcelable.Creator<Voice!> | |
Constants
LATENCY_HIGH
static val LATENCY_HIGH: Int
Network based expected synthesizer latency (~200ms)
Value: 400LATENCY_LOW
static val LATENCY_LOW: Int
Low expected synthesizer latency (~20ms)
Value: 200LATENCY_NORMAL
static val LATENCY_NORMAL: Int
Normal expected synthesizer latency (~50ms)
Value: 300LATENCY_VERY_HIGH
static val LATENCY_VERY_HIGH: Int
Very slow network based expected synthesizer latency (> 200ms)
Value: 500LATENCY_VERY_LOW
static val LATENCY_VERY_LOW: Int
Very low expected synthesizer latency (< 20ms)
Value: 100QUALITY_HIGH
static val QUALITY_HIGH: Int
High, human-like quality of speech synthesis
Value: 400QUALITY_LOW
static val QUALITY_LOW: Int
Low, not human-like quality of speech synthesis
Value: 200QUALITY_NORMAL
static val QUALITY_NORMAL: Int
Normal quality of speech synthesis
Value: 300QUALITY_VERY_HIGH
static val QUALITY_VERY_HIGH: Int
Very high, almost human-indistinguishable quality of speech synthesis
Value: 500QUALITY_VERY_LOW
static val QUALITY_VERY_LOW: Int
Very low, but still intelligible quality of speech synthesis
Value: 100Public constructors
Voice
Voice(
name: String!,
locale: Locale!,
quality: Int,
latency: Int,
requiresNetworkConnection: Boolean,
features: MutableSet<String!>!)
Public methods
describeContents
open fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
open fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value
x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| Parameters | |
|---|---|
obj |
This value may be null. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getFeatures
open fun getFeatures(): MutableSet<String!>!
Returns the set of features it supports for a given voice. Features can either be framework defined, e.g. TextToSpeech.Engine.KEY_FEATURE_NETWORK_TIMEOUT_MS or engine specific. Engine specific keys must be prefixed by the name of the engine they are intended for. These keys can be used as parameters to TextToSpeech.speak(String, int, java.util.HashMap) and TextToSpeech.synthesizeToFile(String, java.util.HashMap, String). Features values are strings and their values must met restrictions described in their documentation.
| Return | |
|---|---|
MutableSet<String!>! |
Set instance. May return null on error. |
getLatency
open fun getLatency(): Int
| Return | |
|---|---|
Int |
The voice's latency (lower is better) |
getQuality
open fun getQuality(): Int
| Return | |
|---|---|
Int |
The voice's quality (higher is better) |
hashCode
open fun hashCode(): Int
| Return | |
|---|---|
Int |
a hash code value for this object. |
isNetworkConnectionRequired
open fun isNetworkConnectionRequired(): Boolean
| Return | |
|---|---|
Boolean |
Does the Voice require a network connection to work. |
toString
open fun toString(): String
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
open fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
| Parameters | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |