Class AwsTranscriptionService
Implements
Inherited Members
Namespace: Glitch9.AIDevKit.AmazonAws
Assembly: Glitch9.AIDevKit.Provider.AmazonAws.dll
Syntax
public class AwsTranscriptionService : IWebSocketSpeechToTextService, ISpeechToText, IWebSocketGenerativeService<AudioClip, TranscriptDelta, Transcript, ISpeechToTextOptions>, IDisposable, IAgentDependency
Constructors
| Edit this page View SourceAwsTranscriptionService()
Declaration
public AwsTranscriptionService()
Methods
| Edit this page View SourceCancelAsync()
Cancels any ongoing operations and cleans up resources.
Declaration
public UniTask CancelAsync()
Returns
| Type | Description |
|---|---|
| UniTask |
ConnectAsync(ISpeechToTextOptions, CancellationToken)
Establishes a WebSocket connection. Events/deltas are received through implementation-specific listeners or callbacks.
Declaration
public UniTask ConnectAsync(ISpeechToTextOptions settings, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ISpeechToTextOptions | settings | The generation settings. |
| CancellationToken | ct | The cancellation token. |
Returns
| Type | Description |
|---|---|
| UniTask |
DisconnectAsync(CancellationToken)
Closes the WebSocket connection gracefully.
Declaration
public UniTask DisconnectAsync(CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | ct | The cancellation token. |
Returns
| Type | Description |
|---|---|
| UniTask |
Dispose()
Declaration
public void Dispose()
InitWithAgentAsync(Agent, CancellationToken)
Initializes this dependency with the given agent.
Declaration
public UniTask InitWithAgentAsync(Agent agent, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Agent | agent | |
| CancellationToken | ct |
Returns
| Type | Description |
|---|---|
| UniTask |
PushInputAudioBuffer(float[])
Pushes a raw audio buffer to the WebSocket service. This method is intended for real-time microphone input streaming.
Declaration
public void PushInputAudioBuffer(float[] audioBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| float[] | audioBuffer | The raw audio buffer (float[] PCM data). |
PushInputBuffer(AudioClip)
Pushes input data through the active WebSocket connection. The connection must be established via ConnectAsync(TSettings, CancellationToken) before calling this method. Data is queued and sent asynchronously in the background.
Declaration
public void PushInputBuffer(AudioClip input)
Parameters
| Type | Name | Description |
|---|---|---|
| AudioClip | input | The input data to push. |