Share via


ISpeechToTextClient.GetTextAsync Method

Definition

Sends audio speech content to the model and returns the generated text.

public System.Threading.Tasks.Task<Microsoft.Extensions.AI.SpeechToTextResponse> GetTextAsync(System.IO.Stream audioSpeechStream, Microsoft.Extensions.AI.SpeechToTextOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTextAsync : System.IO.Stream * Microsoft.Extensions.AI.SpeechToTextOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.SpeechToTextResponse>
Public Function GetTextAsync (audioSpeechStream As Stream, Optional options As SpeechToTextOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of SpeechToTextResponse)

Parameters

audioSpeechStream
Stream

The audio speech stream to send.

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.

Applies to