TextToSpeech.SynthesizeToFile Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SynthesizeToFile(String, IDictionary<String,String>, String) |
Obsolete.
Synthesizes the given text to a file using the specified parameters. |
SynthesizeToFile(ICharSequence, Bundle, ParcelFileDescriptor, String) |
Synthesizes the given text to a ParcelFileDescriptor using the specified parameters. |
SynthesizeToFile(ICharSequence, Bundle, File, String) |
Synthesizes the given text to a file using the specified parameters. |
SynthesizeToFile(String, Bundle, ParcelFileDescriptor, String) |
Synthesizes the given text to a ParcelFileDescriptor using the specified parameters. |
SynthesizeToFile(String, Bundle, File, String) |
Synthesizes the given text to a file using the specified parameters. |
SynthesizeToFile(String, IDictionary<String,String>, String)
Caution
deprecated
Synthesizes the given text to a file using the specified parameters.
[Android.Runtime.Register("synthesizeToFile", "(Ljava/lang/String;Ljava/util/HashMap;Ljava/lang/String;)I", "GetSynthesizeToFile_Ljava_lang_String_Ljava_util_HashMap_Ljava_lang_String_Handler")]
[System.Obsolete("deprecated")]
public virtual Android.Speech.Tts.OperationResult SynthesizeToFile (string? text, System.Collections.Generic.IDictionary<string,string>? params, string? filename);
[<Android.Runtime.Register("synthesizeToFile", "(Ljava/lang/String;Ljava/util/HashMap;Ljava/lang/String;)I", "GetSynthesizeToFile_Ljava_lang_String_Ljava_util_HashMap_Ljava_lang_String_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member SynthesizeToFile : string * System.Collections.Generic.IDictionary<string, string> * string -> Android.Speech.Tts.OperationResult
override this.SynthesizeToFile : string * System.Collections.Generic.IDictionary<string, string> * string -> Android.Speech.Tts.OperationResult
Parameters
- text
- String
The text that should be synthesized. No longer than
#getMaxSpeechInputLength()
characters.
- params
- IDictionary<String,String>
Parameters for the request. Cannot be null.
Supported parameter names:
Engine#KEY_PARAM_UTTERANCE_ID
.
Engine specific parameters may be passed in but the parameter keys
must be prefixed by the name of the engine they are intended for. For example
the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the
engine named "com.svox.pico" if it is being used.
- filename
- String
Absolute file filename to write the generated audio data to.It should be something like "/sdcard/myappsounds/mysound.wav".
Returns
#ERROR
or #SUCCESS
of <b>queuing</b> the synthesizeToFile operation.
- Attributes
Remarks
Synthesizes the given text to a file using the specified parameters. This method is asynchronous, i.e. the method just adds the request to the queue of TTS requests and then returns. The synthesis might not have finished (or even started!) at the time when this method returns. In order to reliably detect errors during synthesis, we recommend setting an utterance progress listener (see #setOnUtteranceProgressListener
) and using the Engine#KEY_PARAM_UTTERANCE_ID
parameter.
This member is deprecated. As of API level 21, replaced by #synthesizeToFile(CharSequence, Bundle, File, 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
SynthesizeToFile(ICharSequence, Bundle, ParcelFileDescriptor, String)
Synthesizes the given text to a ParcelFileDescriptor using the specified parameters.
[Android.Runtime.Register("synthesizeToFile", "(Ljava/lang/CharSequence;Landroid/os/Bundle;Landroid/os/ParcelFileDescriptor;Ljava/lang/String;)I", "GetSynthesizeToFile_Ljava_lang_CharSequence_Landroid_os_Bundle_Landroid_os_ParcelFileDescriptor_Ljava_lang_String_Handler", ApiSince=30)]
public virtual Android.Speech.Tts.OperationResult SynthesizeToFile (Java.Lang.ICharSequence text, Android.OS.Bundle params, Android.OS.ParcelFileDescriptor fileDescriptor, string utteranceId);
[<Android.Runtime.Register("synthesizeToFile", "(Ljava/lang/CharSequence;Landroid/os/Bundle;Landroid/os/ParcelFileDescriptor;Ljava/lang/String;)I", "GetSynthesizeToFile_Ljava_lang_CharSequence_Landroid_os_Bundle_Landroid_os_ParcelFileDescriptor_Ljava_lang_String_Handler", ApiSince=30)>]
abstract member SynthesizeToFile : Java.Lang.ICharSequence * Android.OS.Bundle * Android.OS.ParcelFileDescriptor * string -> Android.Speech.Tts.OperationResult
override this.SynthesizeToFile : Java.Lang.ICharSequence * Android.OS.Bundle * Android.OS.ParcelFileDescriptor * string -> Android.Speech.Tts.OperationResult
Parameters
- text
- ICharSequence
The text that should be synthesized. No longer than
#getMaxSpeechInputLength()
characters.
- params
- Bundle
Parameters for the request. Engine specific parameters may be passed in but the parameter keys must be prefixed by the name of the engine they are intended for. For example the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the engine named "com.svox.pico" if it is being used.
- fileDescriptor
- ParcelFileDescriptor
ParcelFileDescriptor to write the generated audio data to.
- utteranceId
- String
An unique identifier for this request.
Returns
#ERROR
or #SUCCESS
of <b>queuing</b> the synthesizeToFile operation.
- Attributes
Remarks
Synthesizes the given text to a ParcelFileDescriptor using the specified parameters. This method is asynchronous, i.e. the method just adds the request to the queue of TTS requests and then returns. The synthesis might not have finished (or even started!) at the time when this method returns. In order to reliably detect errors during synthesis, we recommend setting an utterance progress listener (see #setOnUtteranceProgressListener
).
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
SynthesizeToFile(ICharSequence, Bundle, File, String)
Synthesizes the given text to a file using the specified parameters.
[Android.Runtime.Register("synthesizeToFile", "(Ljava/lang/CharSequence;Landroid/os/Bundle;Ljava/io/File;Ljava/lang/String;)I", "GetSynthesizeToFile_Ljava_lang_CharSequence_Landroid_os_Bundle_Ljava_io_File_Ljava_lang_String_Handler")]
public virtual Android.Speech.Tts.OperationResult SynthesizeToFile (Java.Lang.ICharSequence? text, Android.OS.Bundle? params, Java.IO.File? file, string? utteranceId);
[<Android.Runtime.Register("synthesizeToFile", "(Ljava/lang/CharSequence;Landroid/os/Bundle;Ljava/io/File;Ljava/lang/String;)I", "GetSynthesizeToFile_Ljava_lang_CharSequence_Landroid_os_Bundle_Ljava_io_File_Ljava_lang_String_Handler")>]
abstract member SynthesizeToFile : Java.Lang.ICharSequence * Android.OS.Bundle * Java.IO.File * string -> Android.Speech.Tts.OperationResult
override this.SynthesizeToFile : Java.Lang.ICharSequence * Android.OS.Bundle * Java.IO.File * string -> Android.Speech.Tts.OperationResult
Parameters
- text
- ICharSequence
The text that should be synthesized. No longer than
#getMaxSpeechInputLength()
characters.
- params
- Bundle
Parameters for the request. Cannot be null. Engine specific parameters may be passed in but the parameter keys must be prefixed by the name of the engine they are intended for. For example the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the engine named "com.svox.pico" if it is being used.
- file
- File
File to write the generated audio data to.
- utteranceId
- String
An unique identifier for this request.
Returns
#ERROR
or #SUCCESS
of <b>queuing</b> the synthesizeToFile operation.
- Attributes
Remarks
Synthesizes the given text to a file using the specified parameters. This method is asynchronous, i.e. the method just adds the request to the queue of TTS requests and then returns. The synthesis might not have finished (or even started!) at the time when this method returns. In order to reliably detect errors during synthesis, we recommend setting an utterance progress listener (see #setOnUtteranceProgressListener
).
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
SynthesizeToFile(String, Bundle, ParcelFileDescriptor, String)
Synthesizes the given text to a ParcelFileDescriptor using the specified parameters.
public Android.Speech.Tts.OperationResult SynthesizeToFile (string text, Android.OS.Bundle params, Android.OS.ParcelFileDescriptor fileDescriptor, string utteranceId);
member this.SynthesizeToFile : string * Android.OS.Bundle * Android.OS.ParcelFileDescriptor * string -> Android.Speech.Tts.OperationResult
Parameters
- text
- String
The text that should be synthesized. No longer than
#getMaxSpeechInputLength()
characters.
- params
- Bundle
Parameters for the request. Engine specific parameters may be passed in but the parameter keys must be prefixed by the name of the engine they are intended for. For example the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the engine named "com.svox.pico" if it is being used.
- fileDescriptor
- ParcelFileDescriptor
ParcelFileDescriptor to write the generated audio data to.
- utteranceId
- String
An unique identifier for this request.
Returns
#ERROR
or #SUCCESS
of <b>queuing</b> the synthesizeToFile operation.
Remarks
Synthesizes the given text to a ParcelFileDescriptor using the specified parameters. This method is asynchronous, i.e. the method just adds the request to the queue of TTS requests and then returns. The synthesis might not have finished (or even started!) at the time when this method returns. In order to reliably detect errors during synthesis, we recommend setting an utterance progress listener (see #setOnUtteranceProgressListener
).
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
SynthesizeToFile(String, Bundle, File, String)
Synthesizes the given text to a file using the specified parameters.
public Android.Speech.Tts.OperationResult SynthesizeToFile (string? text, Android.OS.Bundle? params, Java.IO.File? file, string? utteranceId);
member this.SynthesizeToFile : string * Android.OS.Bundle * Java.IO.File * string -> Android.Speech.Tts.OperationResult
Parameters
- text
- String
The text that should be synthesized. No longer than
#getMaxSpeechInputLength()
characters.
- params
- Bundle
Parameters for the request. Cannot be null. Engine specific parameters may be passed in but the parameter keys must be prefixed by the name of the engine they are intended for. For example the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the engine named "com.svox.pico" if it is being used.
- file
- File
File to write the generated audio data to.
- utteranceId
- String
An unique identifier for this request.
Returns
#ERROR
or #SUCCESS
of <b>queuing</b> the synthesizeToFile operation.
Remarks
Synthesizes the given text to a file using the specified parameters. This method is asynchronous, i.e. the method just adds the request to the queue of TTS requests and then returns. The synthesis might not have finished (or even started!) at the time when this method returns. In order to reliably detect errors during synthesis, we recommend setting an utterance progress listener (see #setOnUtteranceProgressListener
).
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.