# ISpeechTranscriber

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.ispeechtranscriber/
> Summary: ISpeechTranscriber: A provider that transcribes speech to text.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

A provider that transcribes speech to text.

```csharp
public interface ISpeechTranscriber
```

## Remarks

The contract is single-shot. The *incremental* resolution the live conversation layer
will need should be a separate interface; adding a member here breaks consumer implementations.

**DI lifetime — singleton.** The unnamed default is registered as a
singleton with `TryAdd`; a consumer's own registration wins. More
transcribers are registered by name with `AddSpeechTranscriber`.

**Tenant behavior — TENANT-INDEPENDENT implementation, tenant-gated calls.**
The same rule as [ISpeechSynthesizer](/api/tracon.ispeechsynthesizer/): the instance never reads the
tenant, and Tracon resolves it
through the tenant's checks, and passes the tenant's own credential in
[SpeechTranscriptionOptions.Credential](/api/tracon.speechtranscriptionoptions/#Tracon_SpeechTranscriptionOptions_Credential) only when
[ISpeechTranscriber.SupportsTenantCredentials](/api/tracon.ispeechtranscriber/#Tracon_ISpeechTranscriber_SupportsTenantCredentials) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

## Properties

### <a id="Tracon_ISpeechTranscriber_ProviderName"></a> ProviderName

The provider name.

```csharp
string ProviderName { get; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

#### Remarks

A tenant's egress policy and provider bindings name this value.

### <a id="Tracon_ISpeechTranscriber_SupportsTenantCredentials"></a> SupportsTenantCredentials

Gets whether the transcriber honours a tenant credential passed in
[SpeechTranscriptionOptions.Credential](/api/tracon.speechtranscriptionoptions/#Tracon_SpeechTranscriptionOptions_Credential).

```csharp
bool SupportsTenantCredentials { get; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Remarks

The default is [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool): Tracon refuses a call for a tenant that
has its own binding for [ISpeechTranscriber.ProviderName](/api/tracon.ispeechtranscriber/#Tracon_ISpeechTranscriber_ProviderName) rather than make it on the
configured credential.

## Methods

### <a id="Tracon_ISpeechTranscriber_TranscribeAsync_System_IO_Stream_System_String_Tracon_SpeechTranscriptionOptions_System_Threading_CancellationToken_"></a> TranscribeAsync\(Stream, string, SpeechTranscriptionOptions?, CancellationToken\)

Transcribes an audio stream to text.

```csharp
ValueTask<SpeechTranscript> TranscribeAsync(Stream audio, string mediaType, SpeechTranscriptionOptions? options = null, CancellationToken cancellationToken = default)
```

#### Parameters

`audio` [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream)

The audio stream.

`mediaType` [string](https://learn.microsoft.com/dotnet/api/system.string)

The audio's MIME type.

`options` [SpeechTranscriptionOptions](/api/tracon.speechtranscriptionoptions/)?

The settings.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[SpeechTranscript](/api/tracon.speechtranscript/)\>

The transcribed text.
