SmartAudioTTSAdapter
Wisej.AI.Adapters.SmartAudioTTSAdapter
Last updated
Wisej.AI.Adapters.SmartAudioTTSAdapter
Last updated
Namespace: Wisej.AI.Adapters
Assembly: Wisej.AI (3.5.0.0)
Converts the of the associated control into lifelike speech.
This class works with the OpenAI TTS platform to generate audio from text. To use this adapter, set the Text property of the control to the desired text. If is true, the audio is generated automatically when the text changes. The input text is limited to 4096 characters. If is false, call with the control to generate the audio. The generated audio file is saved in the directory at the root of the project. The file name is a combination of the control's and a unique hash code, with the extension specified by .
Initializes a new instance of .
: Gets or sets the path where audio files are stored. (Default: "~AI\AudioFiles"
)
The path should be relative to the application's root folder to allow the audio control to download the audio as a regular URL.
The default format is "mp3". Other available formats include "opus", "aac", "flac", and "pcm".
The speed can range from 0.25 to 4.0, with 1.0 as the default value.
The available voices are optimized for English. Supported voices include: Alloy (default), Echo, Fable, Onyx, Nova, and Shimmer. New voices can be used as they become available.
control
control
Asynchronously generates audio from the text of the specified control.
control
The control containing the text to convert to audio.
Throws:
Represents a provider that supplies tools.
: Gets or sets the audio format for the generated speech. (Default: "mp3"
)
: Gets or sets the speed of the generated audio. (Default: 1
)
: Gets or sets the voice to use for speech synthesis. (Default: "Alloy"
)
Returns: . A task representing the asynchronous operation, with a result containing the response.
Thrown if or is null or empty.