Condividi tramite


TextToSpeech.AddSpeech Method

Definition

Overloads

AddSpeech(String, String, Int32)

Adds a mapping between a string of text and a sound resource in a package.

AddSpeech(ICharSequence, String, Int32)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) of text and a sound resource in a package.

AddSpeech(String, File)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file.

AddSpeech(String, String)

Adds a mapping between a string of text and a sound file.

AddSpeech(ICharSequence, File)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file.

AddSpeech(ICharSequence, Uri)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file.

AddSpeech(String, Uri)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file.

AddSpeech(String, String, Int32)

Adds a mapping between a string of text and a sound resource in a package.

[Android.Runtime.Register("addSpeech", "(Ljava/lang/String;Ljava/lang/String;I)I", "GetAddSpeech_Ljava_lang_String_Ljava_lang_String_IHandler")]
public virtual Android.Speech.Tts.OperationResult AddSpeech (string? text, string? packagename, int resourceId);
[<Android.Runtime.Register("addSpeech", "(Ljava/lang/String;Ljava/lang/String;I)I", "GetAddSpeech_Ljava_lang_String_Ljava_lang_String_IHandler")>]
abstract member AddSpeech : string * string * int -> Android.Speech.Tts.OperationResult
override this.AddSpeech : string * string * int -> Android.Speech.Tts.OperationResult

Parameters

text
String

The string of text. Example: "south_south_east"

packagename
String

Pass the packagename of the application that contains the resource. If the resource is in your own application (this is the most common case), then put the packagename of your application here.<br/> Example: <b>"com.google.marvin.compass"</b><br/> The packagename can be found in the AndroidManifest.xml of your application. <p> &lt;manifest xmlns:android=&quot;...&quot; package=&quot;<b>com.google.marvin.compass</b>&quot;&gt;</p>

resourceId
Int32

Example: R.raw.south_south_east

Returns

Code indicating success or failure. See #ERROR and #SUCCESS.

Attributes

Remarks

Adds a mapping between a string of text and a sound resource in a package. After a call to this method, subsequent calls to #speak(CharSequence, int, Bundle, String) will play the specified sound resource if it is available, or synthesize the text it is missing.

Java documentation for android.speech.tts.TextToSpeech.addSpeech(java.lang.String, java.lang.String, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddSpeech(ICharSequence, String, Int32)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) of text and a sound resource in a package.

[Android.Runtime.Register("addSpeech", "(Ljava/lang/CharSequence;Ljava/lang/String;I)I", "GetAddSpeech_Ljava_lang_CharSequence_Ljava_lang_String_IHandler")]
public virtual Android.Speech.Tts.OperationResult AddSpeech (Java.Lang.ICharSequence? text, string? packagename, int resourceId);
[<Android.Runtime.Register("addSpeech", "(Ljava/lang/CharSequence;Ljava/lang/String;I)I", "GetAddSpeech_Ljava_lang_CharSequence_Ljava_lang_String_IHandler")>]
abstract member AddSpeech : Java.Lang.ICharSequence * string * int -> Android.Speech.Tts.OperationResult
override this.AddSpeech : Java.Lang.ICharSequence * string * int -> Android.Speech.Tts.OperationResult

Parameters

text
ICharSequence

The string of text. Example: "south_south_east"

packagename
String

Pass the packagename of the application that contains the resource. If the resource is in your own application (this is the most common case), then put the packagename of your application here.<br/> Example: <b>"com.google.marvin.compass"</b><br/> The packagename can be found in the AndroidManifest.xml of your application. <p> &lt;manifest xmlns:android=&quot;...&quot; package=&quot;<b>com.google.marvin.compass</b>&quot;&gt;</p>

resourceId
Int32

Example: R.raw.south_south_east

Returns

Code indicating success or failure. See #ERROR and #SUCCESS.

Attributes

Remarks

Adds a mapping between a CharSequence (may be spanned with TtsSpans) of text and a sound resource in a package. After a call to this method, subsequent calls to #speak(CharSequence, int, Bundle, String) will play the specified sound resource if it is available, or synthesize the text it is missing.

Java documentation for android.speech.tts.TextToSpeech.addSpeech(java.lang.CharSequence, java.lang.String, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddSpeech(String, File)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file.

public Android.Speech.Tts.OperationResult AddSpeech (string? text, Java.IO.File? file);
member this.AddSpeech : string * Java.IO.File -> Android.Speech.Tts.OperationResult

Parameters

text
String

The string of text. Example: "south_south_east"

file
File

File object pointing to the sound file.

Returns

Code indicating success or failure. See #ERROR and #SUCCESS.

Remarks

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file. Using this, it is possible to add custom pronounciations for a string of text. After a call to this method, subsequent calls to #speak(CharSequence, int, Bundle, String) will play the specified sound resource if it is available, or synthesize the text it is missing.

Java documentation for android.speech.tts.TextToSpeech.addSpeech(java.lang.CharSequence, java.io.File).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddSpeech(String, String)

Adds a mapping between a string of text and a sound file.

[Android.Runtime.Register("addSpeech", "(Ljava/lang/String;Ljava/lang/String;)I", "GetAddSpeech_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual Android.Speech.Tts.OperationResult AddSpeech (string? text, string? filename);
[<Android.Runtime.Register("addSpeech", "(Ljava/lang/String;Ljava/lang/String;)I", "GetAddSpeech_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member AddSpeech : string * string -> Android.Speech.Tts.OperationResult
override this.AddSpeech : string * string -> Android.Speech.Tts.OperationResult

Parameters

text
String

The string of text. Example: "south_south_east"

filename
String

The full path to the sound file (for example: "/sdcard/mysounds/hello.wav")

Returns

Code indicating success or failure. See #ERROR and #SUCCESS.

Attributes

Remarks

Adds a mapping between a string of text and a sound file. Using this, it is possible to add custom pronounciations for a string of text. After a call to this method, subsequent calls to #speak(CharSequence, int, Bundle, String) will play the specified sound resource if it is available, or synthesize the text it is missing.

Java documentation for android.speech.tts.TextToSpeech.addSpeech(java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddSpeech(ICharSequence, File)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file.

[Android.Runtime.Register("addSpeech", "(Ljava/lang/CharSequence;Ljava/io/File;)I", "GetAddSpeech_Ljava_lang_CharSequence_Ljava_io_File_Handler")]
public virtual Android.Speech.Tts.OperationResult AddSpeech (Java.Lang.ICharSequence? text, Java.IO.File? file);
[<Android.Runtime.Register("addSpeech", "(Ljava/lang/CharSequence;Ljava/io/File;)I", "GetAddSpeech_Ljava_lang_CharSequence_Ljava_io_File_Handler")>]
abstract member AddSpeech : Java.Lang.ICharSequence * Java.IO.File -> Android.Speech.Tts.OperationResult
override this.AddSpeech : Java.Lang.ICharSequence * Java.IO.File -> Android.Speech.Tts.OperationResult

Parameters

text
ICharSequence

The string of text. Example: "south_south_east"

file
File

File object pointing to the sound file.

Returns

Code indicating success or failure. See #ERROR and #SUCCESS.

Attributes

Remarks

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file. Using this, it is possible to add custom pronounciations for a string of text. After a call to this method, subsequent calls to #speak(CharSequence, int, Bundle, String) will play the specified sound resource if it is available, or synthesize the text it is missing.

Java documentation for android.speech.tts.TextToSpeech.addSpeech(java.lang.CharSequence, java.io.File).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddSpeech(ICharSequence, Uri)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file.

[Android.Runtime.Register("addSpeech", "(Ljava/lang/CharSequence;Landroid/net/Uri;)I", "GetAddSpeech_Ljava_lang_CharSequence_Landroid_net_Uri_Handler", ApiSince=31)]
public virtual Android.Speech.Tts.OperationResult AddSpeech (Java.Lang.ICharSequence text, Android.Net.Uri uri);
[<Android.Runtime.Register("addSpeech", "(Ljava/lang/CharSequence;Landroid/net/Uri;)I", "GetAddSpeech_Ljava_lang_CharSequence_Landroid_net_Uri_Handler", ApiSince=31)>]
abstract member AddSpeech : Java.Lang.ICharSequence * Android.Net.Uri -> Android.Speech.Tts.OperationResult
override this.AddSpeech : Java.Lang.ICharSequence * Android.Net.Uri -> Android.Speech.Tts.OperationResult

Parameters

text
ICharSequence

The string of text. Example: "south_south_east"

uri
Uri

Uri object pointing to the sound file.

Returns

Code indicating success or failure. See #ERROR and #SUCCESS.

Attributes

Remarks

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file. Using this, it is possible to add custom pronounciations for a string of text. After a call to this method, subsequent calls to #speak(CharSequence, int, Bundle, String) will play the specified sound resource if it is available, or synthesize the text it is missing.

Java documentation for android.speech.tts.TextToSpeech.addSpeech(java.lang.CharSequence, android.net.Uri).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddSpeech(String, Uri)

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file.

public Android.Speech.Tts.OperationResult AddSpeech (string text, Android.Net.Uri uri);
member this.AddSpeech : string * Android.Net.Uri -> Android.Speech.Tts.OperationResult

Parameters

text
String

The string of text. Example: "south_south_east"

uri
Uri

Uri object pointing to the sound file.

Returns

Code indicating success or failure. See #ERROR and #SUCCESS.

Remarks

Adds a mapping between a CharSequence (may be spanned with TtsSpans) and a sound file. Using this, it is possible to add custom pronounciations for a string of text. After a call to this method, subsequent calls to #speak(CharSequence, int, Bundle, String) will play the specified sound resource if it is available, or synthesize the text it is missing.

Java documentation for android.speech.tts.TextToSpeech.addSpeech(java.lang.CharSequence, android.net.Uri).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to