Share via


SpeechToTextClientExtensions.GetTextAsync Method

Definition

Generates text from speech providing a single audio speech DataContent.

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.SpeechToTextResponse> GetTextAsync(this Microsoft.Extensions.AI.ISpeechToTextClient client, Microsoft.Extensions.AI.DataContent audioSpeechContent, Microsoft.Extensions.AI.SpeechToTextOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member GetTextAsync : Microsoft.Extensions.AI.ISpeechToTextClient * Microsoft.Extensions.AI.DataContent * Microsoft.Extensions.AI.SpeechToTextOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.SpeechToTextResponse>
<Extension()>
Public Function GetTextAsync (client As ISpeechToTextClient, audioSpeechContent As DataContent, Optional options As SpeechToTextOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of SpeechToTextResponse)

Parameters

client
ISpeechToTextClient

The client.

audioSpeechContent
DataContent

The single audio speech content.

options
SpeechToTextOptions

The speech to text options to configure the request.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

The text generated by the client.

Applies to