Class DefaultTextToSpeechService
Implements
Inherited Members
Namespace: Glitch9.AIDevKit
Assembly: Glitch9.AIDevKit.dll
Syntax
public sealed class DefaultTextToSpeechService : GenerativeServiceBase, ITextToSpeechService, IGenerativeService<string, IAudioAsset, ITextToSpeechOptions>, IStreamingTextToSpeechService, ITextToSpeech, IStreamingGenerativeService<string, Delta<IAudioChunk>, IAudioAsset, ITextToSpeechOptions>, IDisposable
Methods
| Edit this page View SourceGenerateAsync(string, ITextToSpeechOptions, CancellationToken)
Generates a final output asynchronously.
Declaration
public UniTask<Generated<IAudioAsset>> GenerateAsync(string input, ITextToSpeechOptions settings, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | input | The input data. |
| ITextToSpeechOptions | settings | The generation settings. |
| CancellationToken | ct | The cancellation token. |
Returns
| Type | Description |
|---|---|
| UniTask<Generated<IAudioAsset>> | The generated result. |
StreamAsync(string, ITextToSpeechOptions, CancellationToken)
Starts a streaming generation request asynchronously.
Declaration
public UniTask<IGenerativeStream<Delta<IAudioChunk>, IAudioAsset>> StreamAsync(string input, ITextToSpeechOptions settings, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | input | The input data. |
| ITextToSpeechOptions | settings | The generation settings. |
| CancellationToken | ct | The cancellation token. |
Returns
| Type | Description |
|---|---|
| UniTask<IGenerativeStream<Delta<IAudioChunk>, IAudioAsset>> | A stream handle that emits deltas and eventually provides the final output. |